Default mixin to all routes

Hi everyone!

Is there a way to automatically mix in (a mixin) to all routes - even those generated by Ember?

I’d imagine if it was possible it would be possible somehow in an initializer, but I really have no idea.

Any help would be appreciated.

You can reopen Ember.Route: Ember.Route.reopen(App.YourMixin).

JSBin: http://emberjs.jsbin.com/ivicuvUl/1/edit

1 Like

Thank you sir - should have thought of that!

App.Route is rather the way it should be done

If App.Route exists it is automatically used to create routes

http://emberjs.jsbin.com/OsivuwIh/1/edit

Partially agree with App.Route approach but this approach does not cover generated routes.