I'd like to create a custom Route class in Ember CLI. I have the following example working in an older app written with globals:
App.AuthenticatedRoute = Ember.Route.Extend({
beforeModel: function() {
//Do some things
}
});
App.DashboardRoute = App.AuthenticatedRoute.Extend({});
I'm familiar enough with ES6 modules to know that the example would look something like this...
var AuthenticatedRoute = Ember.Route.Extend({
beforeModel: function() {
//
}
});
export default AuthenticatedRoute;
...but I'm curious about the following:
- Where would this live in the app structure?
- How do I access this subclass in other modules?
Aucun commentaire:
Enregistrer un commentaire