升级到 angularfire 1.2 时,获取 a.ref 不是函数错误 [英] Getting a.ref is not a function error when upgraded to angularfire 1.2

查看:35
本文介绍了升级到 angularfire 1.2 时,获取 a.ref 不是函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码库用于处理 firebase 2.3.1 和 Angularfire 1.1.3

Following codebase used to work with firebase 2.3.1 and Angularfire 1.1.3

Var fb = new firebase("https://database name.firebaseio.com");

var fbObj = $firebaseObject(fb.child("users/" + userId));

我升级到了 firebase3.0 和 Angularfire 1.2.

I upgraded to firebase3.0 and Angularfire 1.2.

结果,上面的代码是这样修改的:

As a result, here is how the above code got modified:

var config = {/* ...  */};
firebase.initializeApp(config);
var fb = firebase.database().ref();

var fbObj = $firebaseObject(fb.child("users/" + userId))

然而上面的代码在实例化fbObj时抛出了错误,例如a.ref is not a function.

The above code however threw error such as a.ref is not a function when instantiating fbObj.

请提出建议.

推荐答案

你不应该将你的 firebase 升级到 3.0,因为 AngularFire 升级到 3.0 还没有完成.

you should not upgrade your firebase to 3.0 because AngularFire upgrade to 3.0 has not been completed.

参见 GitHub 中的问题:https://github.com/firebase/angularfire/issues/718

See Issue in GitHub : https://github.com/firebase/angularfire/issues/718

这篇关于升级到 angularfire 1.2 时,获取 a.ref 不是函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆