Firebase Error - “FireBase is not defined”

一曲冷凌霜 提交于 2019-12-12 03:28:11

问题


I am trying to utilize angularFire in my app, I followed this guide (https://www.firebase.com/tutorial/#tutorial/angular/0), and I even tried generator-angularfire, however both times, initially I get :

- angular.js:12330 ReferenceError: FireBase is not defined

I'm using this code in my AngularJS App.js :

var macApp = angular.module('macApp', ['firebase']);

macApp.controller('ProdutosCtrl', ['$scope', '$firebaseArray', function ($scope, $firebaseArray) {

var meusProdutos = new FireBase("https://blistering-torch-5296.firebaseio.com/produtos/");
$scope.produtos = $firebaseArray(meusProdutos);

}]);

I added these references to firebase and angularfire in my Index.html:

"https://cdn.firebase.com/js/client/2.2.1/firebase.js"

"https://cdn.firebase.com/libs/angularfire/1.0.0/angularfire.min.js"

Obs: I also try other versions too.

How do I resolve this issue ?


回答1:


I saw the same issue. It is a typo. Instead of FireBase you have to write Firebase.



来源:https://stackoverflow.com/questions/36405435/firebase-error-firebase-is-not-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!