Created
March 12, 2012 18:12
-
-
Save danielevans/2023729 to your computer and use it in GitHub Desktop.
Bindings Problem
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
//This responds to a click in the DOM | |
var newList = App.List.createRecord({}); | |
if(newList.get("valid")) { | |
newList.store.commit(); | |
} else { | |
// my most recent attempt to prevent the bindings | |
App.store.deleteRecord(newList); | |
App.store.removeFromModelArrays(newList); | |
App.listsController.get("collection").removeObject(newList); | |
App.listsController.set("collection", App.store.findAll(App.List)) | |
} |
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
App.ListListsView = Ember.View.extend({ | |
templateName: 'ember/templates/lists/list', | |
listsBinding: "App.listsController.collection" | |
}); |
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
App.listsController = Ember.Object.create({ | |
collection: App.store.findAll(App.List) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment