I'm using UI-Router and trying to implement ngAnimate module animations.
ng-enter works fine. But, I don't see ng-leave being added to the DOM. I understand that class will be added temporarily and removed, but it didn't.
I'm using AngularJS 1.4.7 and UI Router v0.2.15
Here's my code:
index.html
<div class="row">
<form class="form-horizontal form-left" name="formProfile" novalidate ng-controller="profileController">
<fieldset>
<div id="form-views" ui-view></div>
</fieldset>
</form>
</div>
View1.html (This is default view that will be loaded into index.html)
<p>View 1 State</p>
<a class="btn btn-sm btn-primary btn-block btn-cm" ui-sref="create.view2">Next</a>
<div ui-view></div>
View2.html
<p>View 2 State</p>
<a class="btn btn-sm btn-primary btn-block btn-cm">Finish</a>
app.js
angular.module('profileModule',['ui.router', 'ngAnimate']);
angular.module('profileModule').run(['$state',function($state){
$state.go('create');
}]);
angular.module('profileModule').config(['$stateProvider','$locationProvider',function($stateProvider,$locationProvider){
$stateProvider.state('create', {
url:'/create',
templateUrl: 'view1.html',
controller: 'profileController'
});
$stateProvider.state('create.view2', {
url:'/view2',
templateUrl: 'view2.html',
});
}]);
Any suggestions why ng-leave is not being added to <div id="form-views" ui-view></div>
when create.view2 state is being loaded?