Last active
December 10, 2015 14:08
-
-
Save alexmcpherson/4445263 to your computer and use it in GitHub Desktop.
Another separation of concerns that's possible:
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
var MyView = Backbone.View.extend({ | |
initialize: function() { | |
this.render(); | |
this.model.on('change', this.update, this); | |
}, | |
render: function() { | |
//Puts el on page, called ONLY once, by init | |
}, | |
update: function() { | |
this.$el.html( /* Some template */ ) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment