angular-google-analytics
angular-google-analytics copied to clipboard
How to use it with ui-router v1.0.x?
$stateChangeSuccess
doesnt exists anymore, but rather you will use
$transitions.onSuccess({}, function() {
});
now, so should I just send the page event myself?
@justinsa this looks like we need to elaborate on the whole core/plugin idea. The idea in #149 won't fully cover this, since we have no access to $transition
without using $injector
. So we can either add this as another if (uiRouterVersion > 1)
conditional or find something future proof.
I'll just use it like this:
app.run(['$location', '$transitions', 'Analytics', ($location:any, $transitions:any, Analytics:any) => {
$transitions.onSuccess({}, () => {
Analytics.trackPage($location.path());
});
}]);
in the meantime :)
Good call. ;)