I need to apply different animations depending on the current state using ui-view
. Following on from this question..
I have the following code (edit: see plunker preview)
<section ui-view ng-class="stateClass"></section>
stateClass
gets applied in each controller e.g:
.controller('loginController', function($scope, $state) {
// Set state class name
$scope.stateClass = 'slide-left';
console.log($scope);
This works and the class gets added fine - but the animation wont kick in.
If I was to update the ui-view
code to:
<section ui-view class="slide-left"></section>
with the class hardcoded, this works (but now I can't apply different animations).
Does ng-class
get added after ng-enter
? Can someone suggest how to achieve the animations?
edit>> Oddly enough ng-leave
animations work fine. But css still doesn't apply to ng-enter