我是Angular的新手,我从课本中看到了一些代码,如下所示:
...
@ContentChildren(PaCellColor)
contentChildren: QueryList<PaCellColor>;
ngAfterContentInit() {
this.contentChildren.changes.subscribe(() => {
setTimeout(() => this.updateContentChildren(this.modelProperty),0);
});
}
我不明白为什么我们需要使用setTimeout
函数?