Created
February 6, 2012 10:40
-
-
Save sanderversluys/1751400 to your computer and use it in GitHub Desktop.
Backbone.js Events
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 object = {}; | |
_.extend(object, Backbone.Events); | |
object.on("alert", function(msg) { | |
alert("Triggered " + msg); | |
}); | |
object.trigger("alert", "an event"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment