
The `activate` hook is not always called when the route is used, specifically it will not be called when the model changes, but the change happened within the same route (for example when switching from /travis-ci/travis-web to /travis-ci/travis-core). `beforeModel` is guaranteed to be called every time the model is changed, both when the route is entered for the first time and on any subsequent calls.
9 lines
157 B
JavaScript
9 lines
157 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Mixin.create({
|
|
beforeModel: function() {
|
|
this._super(...arguments);
|
|
window.scrollTo(0,0);
|
|
}
|
|
});
|