Created
June 7, 2012 05:18
-
-
Save tanqhnguyen/2886729 to your computer and use it in GitHub Desktop.
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 View = Backbone.View.extend({ | |
render: function() { | |
var template = _.template($('#template').html(), {name:'Tan Nguyen'}); | |
this.$el.html(template); | |
} | |
}); | |
var myView = new View(); | |
var object = {}; | |
_.extend(object, Backbone.Events); | |
object.on("alert", function(msg) { | |
alert("Triggered " + msg); | |
}); | |
object.trigger("alert", "an event"); | |
_.template($('#template').html(), {name:'Tan Nguyen'}); | |
<script type="text/template" id="template"> | |
<div id="someElement"> | |
Welcome, <%= name %> | |
</div> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment