I have set up my application states using ui-router:
$stateProvider
.state('app', {
abstract: true,
views: {
'nav@': {
templateUrl: 'app/navbar.html',
controller: 'NavbarController',
controllerAs: 'vm'
},
'main@': {
template: '<div ui-view></div>'
}
}
})
.state('child1', {
url: '/child1',
parent: 'app',
templateUrl: 'app/child1.html',
controller: function($timeout) {
$timeout(function() {
alert('from child_1');
}, 15000)
},
controllerAs: 'vm'
})
.state('child2', {
url: '/child2',
parent: 'app',
templateUrl: 'app/child2.html',
controller: 'ctrl_2',
controllerAs: 'vm'
})
After navigating quickly from /child1
to /child2
(before 15000 milliseconds), I still see the alert message defined in the child1
controller. Is this expected behavior?