新Firebase中的Firebase篝火 [英] Firebase angularfire in new firebase
问题描述
我已经将firebase和angularfire更新到最新版本。 b $ b
BEFORE:// This works :-)
// *** DataService ***
var root = new Firebase(FIREBASE_URL);
var service = {
root:root,
items:root.child('items'),
tastings:root.child('tastings'),
用户:root.child('users'),
votes:root.child('votes')
};
退货服务;
// ***控制器***
$ b $ scope.tastings = $ firebaseArray(dataService.tastings);
AFTER://这行不通: - (
) // *** app.js ***
.run(function(FIREBASE_CONFIG){
firebase.initializeApp(FIREBASE_CONFIG );
));
// *** DataService ***
var root = firebase.database()。ref();
var service = {
root:root,
items:root.child('items'),
tastings:root.child('tastings'),
用户:root.child('users'),
votes:root.child('votes')
};
返回服务;
// ***控制器***
$ scope.tastings = $ firebaseArray(dataService.tastings);
我得到的错误是:必须将有效的Firebase引用传递给$ firebase(不是字符串或URL)
看起来像在Chrome控制台中的firebase引用,当我评估dataService.tastings,虽然有新的属性这个数据库已经被添加了。
AngularFire现在正式更新以支持Firebase 3.xx:)
I have an angular app, which utilizes the angularFire library. It is stated in the firebase documentation that angularfire is supported https://firebase.google.com/support/guides/firebase-web#update_your_firebase_libraries_numbered
I have updated firebase and angularfire to the latest version.
BEFORE: //This works :-)
// *** DataService ***
var root = new Firebase(FIREBASE_URL);
var service = {
root: root,
items: root.child('items'),
tastings: root.child('tastings'),
users: root.child('users'),
votes: root.child('votes')
};
return service;
// *** Controller ***
$scope.tastings = $firebaseArray(dataService.tastings);
AFTER: //This does not work :-(
// *** app.js ***
.run(function (FIREBASE_CONFIG) {
firebase.initializeApp(FIREBASE_CONFIG);
});
// *** DataService ***
var root = firebase.database().ref();
var service = {
root: root,
items: root.child('items'),
tastings: root.child('tastings'),
users: root.child('users'),
votes: root.child('votes')
};
return service;
// *** Controller ***
$scope.tastings = $firebaseArray(dataService.tastings);
The error I am getting: "Must pass a valid Firebase reference to $firebase (not a string or URL)"
It looks like a firebase reference in chrome console when i evaluate dataService.tastings, though there are new properties like database, which has been added.
AngularFire is now officially updated to support Firebase 3.x.x :)
这篇关于新Firebase中的Firebase篝火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!