mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
chore(animation): pass instance to onFinish callbacks
This commit is contained in:
@ -22,6 +22,35 @@ class E2EPage {
|
||||
a.easing(this.easing);
|
||||
a.play();
|
||||
}
|
||||
|
||||
memoryCheck() {
|
||||
let self = this;
|
||||
let count = 0;
|
||||
|
||||
function play() {
|
||||
count++;
|
||||
if (count >= 100) {
|
||||
console.log('Play done');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Play', count);
|
||||
|
||||
let a = new Animation('.green');
|
||||
a.fromTo('translateX', '0px', '200px');
|
||||
a.duration(self.duration);
|
||||
a.easing(self.easing);
|
||||
a.onFinish((animation) => {
|
||||
setTimeout(() => {
|
||||
play();
|
||||
}, 100);
|
||||
animation.destroy();
|
||||
});
|
||||
a.play();
|
||||
}
|
||||
|
||||
play();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
<button ion-item (click)="playGreen()">
|
||||
Play
|
||||
</button>
|
||||
|
||||
<button ion-item (click)="memoryCheck()">
|
||||
Memory Check
|
||||
</button>
|
||||
</ion-list>
|
||||
|
||||
</ion-content>
|
||||
|
Reference in New Issue
Block a user