I have a route nested inside of a parent which inherits from a mixin.
// mixins/authenticated-base-route
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
activate: function (){
console.log('b')
doSomeStuff();
}
});
/pods/admin/route.js
import AuthenticatedBaseRoute from 'web-ui/routes/authenticated-base-route';
export default AuthenticatedBaseRoute.extend({
activate: function () {
console.log('a')
this._super();
console.log('c')
},
});
//pods/admin/flights/route.js
import Ember from 'ember';
export default Ember.Route.extend({
afterModel: function () {
console.log('d')
},
});
My impressions was that route logic executes sequentially from the index route down.
My expectation would be then that my logs would git in the order of : a b c d
In reality though, when I hit the route “/admin/flights” directly through the url bar, the “afterModel” in “/admin/flights” executes before “activate” “admin” causing the log order to be:
“d a b c”
Is this a bug or is this expected behavior. If so can anyone point me to an explanation which would help me wrap my head around determining the execution order?