2015-06-08 51 views
-1

我正在試着學習離子+ firebase。通過tutorial來創建購物清單。它的工作原理罰款離子,但是當我嘗試使用火力點時,出現錯誤:

錯誤:[$注射器:unpr]未知提供商:$ firebaseArrayProvider < - $ firebaseArray < - 物品 http://errors.angularjs.org/1.3.13/ $噴油器/ unpr P0 =%24firebaseArrayProvider%20%3C-%20%24firebaseArray%20%3C-%20Items

還檢查了上述錯誤附帶的鏈接。但我仍然無法清楚地理解其中的原因。

這裏是我的代碼:

index.html app.js

任何幫助是非常讚賞。

[更新]:我現在在我的js文件夾中添加了firebase.js文件,並從那裏引用它。錯誤仍然存​​在。

+0

什麼告訴你的是,你要使用一個$ firebaseArray服務,但沒有連接到它(無供應商)代碼。這通常意味着你忘了將firebase模塊列爲你對應用程序聲明的依賴,並且可能忘記在index.html中包含腳本標記。 BTW不能訪問您的代碼 –

+0

@DayanMorenoLeon這裏是鏈接: index.html - > http://pastebin.com/zEGSN4sA app.js - > http://pastebin.com/FANjdL9v –

+0

對不起,我不能達到那個,我的代理不會允許它 –

回答

2

您需要更新您的angularfire版本,因爲您擁有的版本不支持$ firebaseArray和$ firebaseObject。但是,如果要保留當前版本,請改爲使用$ asArray()和$ asObject()。

希望有幫助!

0

當看一看angularfire.js文件時,我們可以注意到firebaseArray的名稱以大寫F($ FirebaseArray)開頭。如文檔中所示,當我們使用帶有小f的$ firebaseArray時,會出現未知提供者錯誤。

這是出廠聲明:(版本0.9.2 AngularFire)

angular.module('firebase').factory('$FirebaseArray', ["$log", "$firebaseUtils" 

在以後的版本中,這已得到糾正。

希望它有幫助。

1

你必須注入火力點到你的應用程序模塊

angular.module('app', ['ionic', 'app.controllers', 'app.routes', 'app.directives','app.services','firebase']) 
相關問題