-
-
Save berzniz/6ece84cb1bb234fdc6f8 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
var model = new Backbone.Model({counter: 1}); |
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({ | |
render: function() { | |
this.$compile(); | |
return this; | |
} | |
}); | |
var view = new MyView({ | |
el: $('.some-element'), | |
model: model | |
}); |
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
<div class="some-view"> | |
<span bb-bind="counter"></span> | |
</div> |
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
<span bb-bind="counter * 2"></span> | |
<span bb-bind="counter % 2 == 0 ? 'even' : 'odd'"></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment