Last active
August 29, 2015 14:22
-
-
Save geekygrappler/89ef319a584bdb28d7bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function() { | |
return this.store.find('todo'); | |
}, | |
actions: { | |
createTodo: function (newTitle) { | |
// Create the new Todo model | |
var todo = this.store.createRecord('todo', { | |
title: newTitle, | |
isCompleted: false | |
}); | |
// Clear the "New Todo" text field | |
// DELETE THESE LINES!!! | |
// this.controllerFor('todos').set('newTitle', ''); | |
// Save the new model | |
todo.save(); | |
}, | |
// Other Actions | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment