@@ -3309,14 +3309,14 @@ describe('animation query tests', function() {
33093309 } )
33103310 class Cmp {
33113311 exp : any = '' ;
3312- disableExp = false ;
3312+ disabledExp = false ;
33133313 }
33143314
33153315 TestBed . configureTestingModule ( { declarations : [ Cmp ] } ) ;
33163316
33173317 const fixture = TestBed . createComponent ( Cmp ) ;
33183318 const cmp = fixture . componentInstance ;
3319- cmp . disableExp = true ;
3319+ cmp . disabledExp = true ;
33203320 fixture . detectChanges ( ) ;
33213321 resetLog ( ) ;
33223322
@@ -3363,14 +3363,14 @@ describe('animation query tests', function() {
33633363 } )
33643364 class Cmp {
33653365 exp : any = '' ;
3366- disableExp = false ;
3366+ disabledExp = false ;
33673367 }
33683368
33693369 TestBed . configureTestingModule ( { declarations : [ Cmp ] } ) ;
33703370
33713371 const fixture = TestBed . createComponent ( Cmp ) ;
33723372 const cmp = fixture . componentInstance ;
3373- cmp . disableExp = true ;
3373+ cmp . disabledExp = true ;
33743374 fixture . detectChanges ( ) ;
33753375 resetLog ( ) ;
33763376
@@ -3386,6 +3386,63 @@ describe('animation query tests', function() {
33863386 expect ( p2 . duration ) . toEqual ( 1000 ) ;
33873387 expect ( p2 . element . classList . contains ( 'parent' ) ) . toBeTrue ( ) ;
33883388 } ) ;
3389+
3390+ it ( 'should disable the animation for the given element regardless of existing parent element animation queries or child element animation queries' ,
3391+ ( ) => {
3392+ @Component ( {
3393+ selector : 'some-cmp' ,
3394+ template : `
3395+ <div class="parent" [@parentAnimation]="exp">
3396+ <div class="child" [@.disabled]="disabledExp" [@childAnimation]="exp">
3397+ <div class="grand-child" [@grandChildAnimation]="exp"></div>
3398+ </div>
3399+ </div>
3400+ ` ,
3401+ animations : [
3402+ trigger (
3403+ 'parentAnimation' ,
3404+ [
3405+ transition (
3406+ '* => go' ,
3407+ [ query ( '@*' , animateChild ( ) ) , animate ( 1500 , style ( { opacity : 0 } ) ) ] ) ,
3408+ ] ) ,
3409+ trigger (
3410+ 'childAnimation' ,
3411+ [
3412+ transition ( '* => go' , [ animate ( 1000 , style ( { opacity : 0 } ) ) ] ) ,
3413+ ] ) ,
3414+ trigger (
3415+ 'grandChildAnimation' ,
3416+ [
3417+ transition ( '* => go' , [ animate ( 500 , style ( { opacity : 0 } ) ) ] ) ,
3418+ ] ) ,
3419+ ]
3420+ } )
3421+ class Cmp {
3422+ exp : any = '' ;
3423+ disabledExp = false ;
3424+ }
3425+
3426+ TestBed . configureTestingModule ( { declarations : [ Cmp ] } ) ;
3427+
3428+ const fixture = TestBed . createComponent ( Cmp ) ;
3429+ const cmp = fixture . componentInstance ;
3430+ cmp . disabledExp = true ;
3431+ fixture . detectChanges ( ) ;
3432+ resetLog ( ) ;
3433+
3434+ cmp . exp = 'go' ;
3435+ fixture . detectChanges ( ) ;
3436+
3437+ const players = getLog ( ) ;
3438+ expect ( players . length ) . toEqual ( 2 ) ;
3439+
3440+ const [ p1 , p2 ] = players ;
3441+ expect ( p1 . duration ) . toEqual ( 500 ) ;
3442+ expect ( p1 . element . classList . contains ( 'grand-child' ) ) . toBeTrue ( ) ;
3443+ expect ( p2 . duration ) . toEqual ( 1500 ) ;
3444+ expect ( p2 . element . classList . contains ( 'parent' ) ) . toBeTrue ( ) ;
3445+ } ) ;
33893446 } ) ;
33903447 } ) ;
33913448} ) ;
0 commit comments