【发布时间】:2016-11-15 23:49:42
【问题描述】:
我有一个 angular2-meteor 项目,我有一个这个对象的集合:
{ name:"name1", value:4 }
我想要一个值属性数组,例如:
[1, 2, 3, 4]
并且我希望在集合中所做的更改反应性地出现在我的数组上。例如:如果我在我的集合中插入一个新文档,我想在我的值数组中添加一个新项目。 在我的客户端,我像这样订阅这个集合:
this.collectSub = MeteorObservable.subscribe('collection', options).subscribe(() => {
this.objects = MyCollection.find({}, {
sort: {
name: nameOrder
}
}).zone();
});
我尝试在 this.object 上使用 map 函数,但这不起作用。
欢迎任何帮助。谢谢
【问题讨论】:
标签: angular meteor angular-meteor