@@ -3356,6 +3356,49 @@ describe("ngAnimate", function() {
3356
3356
} ) ;
3357
3357
} ) ;
3358
3358
3359
+ it ( 'should animate only the specified CSS className inside ng-if' , function ( ) {
3360
+ var captures = { } ;
3361
+ module ( function ( $animateProvider ) {
3362
+ $animateProvider . classNameFilter ( / p r e f i x e d - a n i m a t i o n / ) ;
3363
+ $animateProvider . register ( '.capture' , function ( ) {
3364
+ return {
3365
+ enter : buildFn ( 'enter' ) ,
3366
+ leave : buildFn ( 'leave' )
3367
+ } ;
3368
+
3369
+ function buildFn ( key ) {
3370
+ return function ( element , className , done ) {
3371
+ captures [ key ] = true ;
3372
+ ( done || className ) ( ) ;
3373
+ }
3374
+ }
3375
+ } ) ;
3376
+ } ) ;
3377
+ inject ( function ( $rootScope , $compile , $rootElement , $document , $sniffer , $animate ) {
3378
+ if ( ! $sniffer . transitions ) return ;
3379
+
3380
+ var upperElement = $compile ( '<div><div ng-if=1><span class="capture prefixed-animation"></span></div></div>' ) ( $rootScope ) ;
3381
+ $rootElement . append ( upperElement ) ;
3382
+ jqLite ( $document [ 0 ] . body ) . append ( $rootElement ) ;
3383
+
3384
+ $rootScope . $digest ( ) ;
3385
+ $animate . triggerCallbacks ( ) ;
3386
+
3387
+ var element = upperElement . find ( 'span' ) ;
3388
+
3389
+ var leaveDone = false ;
3390
+ $animate . leave ( element , function ( ) {
3391
+ leaveDone = true ;
3392
+ } ) ;
3393
+
3394
+ $rootScope . $digest ( ) ;
3395
+ $animate . triggerCallbacks ( ) ;
3396
+
3397
+ expect ( captures [ 'leave' ] ) . toBe ( true ) ;
3398
+ expect ( leaveDone ) . toBe ( true ) ;
3399
+ } ) ;
3400
+ } ) ;
3401
+
3359
3402
it ( 'should respect the most relevant CSS transition property if defined in multiple classes' ,
3360
3403
inject ( function ( $sniffer , $compile , $rootScope , $rootElement , $animate , $timeout ) {
3361
3404
0 commit comments