Default mixin to all routes


#1

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.


#2

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

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


#3

Thank you sir - should have thought of that!


#4

App.Route is rather the way it should be done

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


#5

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