rangma rangma - 1 year ago 114
AngularJS Question

"firebase" is not defined in generator-gulp-angular

I am using


I added firebase and angularfire with

bower install firebase --save
bower install angularfire --save

Then I added firebase in the module as below.

angular.module('myApp', ['firebase']

Then in the MainController, I defined config and initialized as below.

vm.config = {
apiKey: "yuygjgjhghjguyfuyfuyccncvcn",
authDomain: "hjgjhghjghjg.firebaseapp.com",
databaseURL: "https://hjghjgjhghj.firebaseio.com"

function activate() {
$timeout(function() {
vm.classAnimation = 'rubberBand';
}, 4000);

When I do
gulp serve
, But I am getting below error.

29:7 error "firebase" is not defined no-undef

Could you please suggest where I am going wrong.

Answer Source

Make sure you inject the firebase service into your controller