Created
June 16, 2013 08:40
-
-
Save kenji0x02/5791415 to your computer and use it in GitHub Desktop.
トグルのサンプルプログラム。backbone.jsのモデルで使った例。
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
(function() { | |
var Task = Backbone.Model.extend({ | |
defaults: { | |
completed: false | |
}, | |
toggle: function() { | |
this.set('completed', !this.get('completed')); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment