Created
March 9, 2013 00:23
-
-
Save jareiko/5121666 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
class Model extends Backbone.Model | |
initialize: -> | |
super | |
monitor = createAttributeMonitor() | |
# Bind to initial attributes. | |
monitor @, name for name of @attributes | |
# Watch for changes to attributes and rebind as necessary. | |
@on 'change', => | |
monitor @, name for name of @changed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment