【问题标题】:First argument must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]"第一个参数必须是有效的 firebase URL,并且路径不能包含“.”、“#”、“$”、“[”或“]”
【发布时间】:2017-02-25 10:42:48
【问题描述】:

我正在尝试使用 Ionic2 中的 Angularfire2 从 firebase 数据库中读取数据。我的数据结构类似于 user->userID->data。现在我将 userID 作为参数传递到字符串中,如下所示

this.af.database.object('/user/${af.auth.getAuth().uid}/data');

这是给我的错误

第一个参数必须是有效的 Firebase URL,并且路径不能包含 “.”、“#”、“$”、“[”或“]”。

如何在 firebase 的 URL 路径中传递 userID 参数?

【问题讨论】:

  • 使用反引号,而不是常规引号。
  • 谢谢。反引号是我的解决方案。

标签: firebase-realtime-database ionic2 angularfire2


【解决方案1】:

使用反引号解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-12
    • 2020-05-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多