I’m trying to make this function work with meteor 1.3.1 and it seems that it isn’t working or I’m doing it wrong.
Here’s my code:
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import uiRouter from 'angular-ui-router';
import todosList from '../imports/components/todosList/todosList';
import navbar from '../imports/components/navbar/navbar';
import preloader from '../imports/components/preloader/preloader';
app = angular.module('exampleApp', [
angularMeteor,
uiRouter,
todosList.name,
navbar.name,
preloader.name
]);
app.config(function($locationProvider, $stateProvider, $urlRouterProvider) {
$locationProvider.html5Mode(true);
$urlRouterProvider.otherwise("/");
$stateProvider
.state('home', {
url: "/",
templateUrl: "client/home/home.html"
})
.state('contact', {
url: "/contact",
templateUrl: "client/contact/contact.html"
})
.state('login', {
url: "/login",
templateUrl: "client/login/login.html"
});
})
.run(function ($rootScope, $state) {
$rootScope.$on('$stateChangeSuccess', function (evt, toState) {
console.log('test');
});
});
I’ve tried doing just $scope
as well but no success whatsoever.
QUESTION
How do I get the $stateChangeSuccess
functions to work with angular-meteor 1.3.1?