0
votes

I am using AngularFire the npm way for which I have installed AngularFire using

npm install angularfire --save

In my app.js I added the following

require('angularfire');

angular.module('app', [ 'ui.router', 'firebase' ])
     .constant('FirebaseUrl', 'https://<my-app>.firebaseio.com/'));

And I am creating a directive to which I am trying to inject the Firebase object.

'use strict';
var chatDirective = function() {
    return {
        restrict : 'E',
        template : require('./chat.tpl.html'),
        controller: ['$state', 'AuthService', 'firebase',
        function($state, AuthService, firebase) {

        }]
    }
};

On running this I am getting the value of Firebase object in the directive as undefined. Am I missing something?

1

1 Answers

1
votes

firebase soes not match any of the services provided by AngularJS.

I'm not sure what exactly you were trying to do so I'm not sure I can point you to the actual service you need.

Just go over the docs and samples from their repo