Angularfire2-无法将Observable <customtype>强制转换为CustomType

时间:2017-11-09 12:20:41

标签: angular typescript rxjs

我无法像以下那样npm cache clear投放Observable<CustomType>

CustomType

我收到如下错误:

  

Observable无法转换为&#39; CustomType&#39;。财产&#39; typeid&#39;类型&#39; Observable&#39;

中缺少

1 个答案:

答案 0 :(得分:4)

我想你想这样做:

ngOnInit() {
   this.customDocument.valeueChanges().subscribe(res => this.custObject = res);
}

A little about observables。我想你应该先阅读一些文档。

相关问题