Created
November 3, 2010 00:19
-
-
Save quirkey/660577 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 myApp = $.sammy(function() { | |
this.helpers({ | |
loadIndex: function() { | |
// you can do everything you would do in a route here. | |
} | |
}); | |
this.get('#/index', function() { | |
this.loadIndex(); | |
}); | |
}) | |
// overriding: | |
myApp.helpers({ | |
loadIndex: function() { | |
// new index | |
} | |
}) | |
// or as a plugin | |
var overrideApp = function(app) { | |
app.helpers({ | |
loadIndex: function() { ... } | |
}); | |
}; | |
myApp.use(overrideApp); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment