Skip to content

Instantly share code, notes, and snippets.

@zoghal
Created July 5, 2012 05:50
Show Gist options
  • Save zoghal/3051597 to your computer and use it in GitHub Desktop.
Save zoghal/3051597 to your computer and use it in GitHub Desktop.
Ember Router reopen
App = Ember.Application.create();
App.RootState = Em.State.extend({
index : Em.State.extend({
route : '/'
}),
main: Em.State.extend({
route : '/main',
index : Em.State.extend({
route : '/'
})
})
});
App.Router = Ember.Router.extend({
location : 'hash',
enableLogging : true,
root : App.RootState
});
// later...
App.RootState.reopen({
module: Em.State.extend({
route : '/module',
index : Em.State.extend({
route : '/'
})
})
});
App.initialize();​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment