Created
May 9, 2012 16:33
-
-
Save gordonbrander/2646337 to your computer and use it in GitHub Desktop.
Potential Kicks Controller/View API
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
var postModels = new Models(); | |
postModels.fetch(); | |
postModels.on('change', function (postModels) { | |
$('.post').models(postModels) | |
.render(function (model) { | |
$(this) | |
.find('.meta .author').html(model.prop('meta.author')).end() | |
.find('.title').html(model.prop('title')).end(); | |
}) | |
.enter() | |
.render(myMustacheTemplate) | |
.on('click', '.title', function (e) { | |
this.logHit().orWhatever(); | |
return this; | |
}) | |
.end() | |
.exit() | |
.render(function () { | |
return $(node).fadeOut().remove(); | |
}) | |
.end(); | |
return postModels; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment