mercredi 1 juillet 2015

Who defines the "store" object?

from this code snippet :

Todos.TodosController = Ember.ArrayController.extend({
  actions: {
    createTodo: function() {
      // Get the todo title set by the "New Todo" text field
      var title = this.get('newTitle');
      if (!title.trim()) { return; }

      // Create the new Todo model
      var todo = this.store.createRecord('todo', {
        title: title,
        isCompleted: false
      });

      // Clear the "New Todo" text field
      this.set('newTitle', '');

      // Save the new model
      todo.save();
      }
    }
});

which is, in fact, from the Ember website

Who defines (and where is defined) this.store ? I looked in the Controller class and in the DSL




Aucun commentaire:

Enregistrer un commentaire