【发布时间】:2017-12-12 19:28:15
【问题描述】:
saveDetails(){
this.afAuth.authState.take(1).subscribe(auth => {
this.af.object('request/${auth.uid}').set(this.request)
.then();
})
执行此方法后,出现错误:Firebase.child failed: First argument is an invalid path: "request/${auth.uid}"。路径必须是非空字符串,并且不能包含“.”、“#”、“$”、“[”或“]”。尝试删除 $ 但这不起作用。很确定我也没有传入空字符串。
【问题讨论】:
-
如果要使用字符串插值,则需要使用反引号(`)而不是单引号(')来包裹字符串。
-
天哪,非常感谢!
标签: javascript angular firebase firebase-realtime-database ionic2