How to use angularFireAuth values in controllers and services?
问题 Let say I put angularFireAuth inside a service. app.factory('authService', function($rootScope, $timeout, angularFireAuth, FIREBASE_URL) { return function() { angularFireAuth.initialize(new Firebase(FIREBASE_URL), { scope: $rootScope, name: 'user', path: "/" }); $rootScope.$on('angularFireAuth:login', function _set(evt, user) { $timeout(function() { $rootScope.auth = { authenticated: true }; }); }); $rootScope.$on('angularFireAuth:logout', function(){ $timeout(function() { $rootScope.auth = {