refactor(animations): deport TCB away from animation-land forever (#10892)
* feat(animations): support animation trigger template callbacks * refactor(animations): deport TCB away from animation-land forever
This commit is contained in:
@ -10,7 +10,9 @@ import {Component, animate, group, keyframes, sequence, state, style, transition
|
||||
|
||||
@Component({
|
||||
host: {
|
||||
'[@backgroundAnimation]': 'bgStatus'
|
||||
'[@backgroundAnimation]': 'bgStatus',
|
||||
'(@backgroundAnimation.start)': 'bgStatusChanged($event, "started")',
|
||||
'(@backgroundAnimation.done)': 'bgStatusChanged($event, "completed")'
|
||||
},
|
||||
selector: 'animate-app',
|
||||
styleUrls: ['css/animate-app.css'],
|
||||
@ -80,6 +82,10 @@ export class AnimateApp {
|
||||
this.items[Math.floor(Math.random() * this.items.length)] = 99;
|
||||
}
|
||||
|
||||
bgStatusChanged(data: {[key: string]: any}, phase: string) {
|
||||
alert(`backgroundAnimation has ${phase} from ${data['fromState']} to ${data['toState']}`);
|
||||
}
|
||||
|
||||
get state() { return this._state; }
|
||||
set state(s) {
|
||||
this._state = s;
|
||||
|
Reference in New Issue
Block a user