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:
Matias Niemelä
2016-08-22 17:18:25 -07:00
committed by Kara
parent ca41b4f5ff
commit 45e8e73670
15 changed files with 1598 additions and 1125 deletions

View File

@ -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;