【发布时间】:2016-08-24 13:24:44
【问题描述】:
我想在 DOM 中添加新消息时播放动画。
但我不知道如何找到我的对象并使用 (this.zone.run) 函数中的代码对其进行编辑:
addMessage(message: string){
this.messages.unshift(message);
// renderer
this.zone.run(() => {
});
}
这里是 app.component.html
<StackLayout #container>
<ScrollView>
<WrapLayout #red>
<Label class="message" *ngFor="let message of messages" [text]="message"></Label>
</WrapLayout>
</ScrollView>
</StackLayout>
我想编辑 WrapLayout 元素的第一个子元素
【问题讨论】:
标签: nativescript angular2-nativescript