I want to log the user and current route every time a route is visited.
I am sure there are other ways but we do ember-cli-analytics
in router.js init
app/router.js
const Router = EmberRouter.extend( {
init() {
this._super(...arguments);
// do your thing
}
});
Yeah there are a number of ways you could do it but I think @broerseās suggestion of the router makes the most sense. Iād probably use the didTransition
hook on the router personally (docs here).
1 Like
Thanks guys never thought to use the router!