Last active
April 27, 2017 23:26
-
-
Save brettjonesdev/0def1c73b49d7092a4295d636a942f24 to your computer and use it in GitHub Desktop.
This file contains 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
const App = new Application(); | |
App.selectedTodos = new Backbone.Collection(); | |
// List Route | |
const collection = new TodoCollection(); | |
collection.fetch().then(() => { | |
const listView = new ListView({collection}).render(); | |
}); | |
// ListView | |
const ListView = Backbone.View.extend({ | |
select(model) { | |
App.selectedTodos.add(model); | |
}, | |
unselect(model) { | |
App.selectedTodos.remove(model); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment