Created
March 2, 2011 11:20
-
-
Save mharju/850790 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 application = Sammy.Bundle('#element', | |
{ | |
'base': my_app.base, // A Sammy.Application in its own right | |
'add-event': my_app.add_event // So is this | |
}, | |
function() { | |
// Rules how to change states. Can be triggered by binding or routing? | |
this.get('#/add', function() { | |
this.setApplication('add-event'); | |
}); | |
this.bind('some-event', function() { | |
this.setApplication('base'); | |
}); | |
} | |
); | |
$(function() { | |
application.run(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment