0
我有一個angular2-流星的項目,我有這個對象的colecction:更新數組值被動
{ name:"name1", value:4 }
,我想value屬性像數組:
[1, 2, 3, 4]
,我想集合中出現的變化反應出現在我的數組上。例如:如果我在我的集閤中插入一個新文檔,我想在我的數組值中添加一個新項目。 在我的客戶端我訂閱了這個集合是這樣的:
this.collectSub = MeteorObservable.subscribe('collection', options).subscribe(() => {
this.objects = MyCollection.find({}, {
sort: {
name: nameOrder
}
}).zone();
});
我嘗試過this.object使用地圖功能,但這不工作。
任何幫助,歡迎。由於