[英]Angular firestore get single document
You need to declare the product variable with its type 您需要使用其类型声明产品变量
product : Product;
or
product : any;
EDIT: As yurzui mentioned in the above comment, you should use arrow function to refer the context, so that this.product will be defined 编辑:如上面的注释中提到的yurzui,您应该使用箭头函数来引用上下文,以便将this.product定义
We should use arrow function to retain context this
. 我们应该用箭头功能是保持关联
this
。 ( get().then((doc) =>
) As yurzui commented. (
get().then((doc) =>
)正如yurzui所说。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.