Skip to content

Instantly share code, notes, and snippets.

@mharju
Created March 2, 2011 11:20
Show Gist options
  • Save mharju/850790 to your computer and use it in GitHub Desktop.
Save mharju/850790 to your computer and use it in GitHub Desktop.
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