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

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

问题描述

以下代码库与Firebase 2.3.1和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。
$ b $ p
$ b $ p

pre $ var config = {/ * ... * /};
firebase.initializeApp(config);
var fb = firebase.database()。ref();
$ b $ var bbj = $ firebaseObject(fb.child(users /+ userId))

上面的代码抛出错误,例如a.ref不是实例化fbObj时的函数。



请建议。


您不应该将您的Firebase升级到3.0,因为AngularFire升级到3.0还没有完成。



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


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));

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))

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

Please suggest.

解决方案

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

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

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

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