当组件首次加载绑定时,直到我强制进行更改检测才会显示。这是代码:
export class MyClass extends MeteorComponent {
list: Mongo.Cursor<Any>;
constructor() {
super();
this.list = MyCollection.find();
}
}
我也试过这个,但结果相同:
视图加载时没有结果,直到第一次更改检测发生。
export class MyClass extends MeteorComponent {
list: Mongo.Cursor<Any>;
constructor(private zone: NgZone) {
super();
this.autorun(() => this.zone.run(() => {
this.list = MyCollection.find();
}))
}
}