Created
April 23, 2014 13:10
-
-
Save EnchanterIO/11214651 to your computer and use it in GitHub Desktop.
App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Declare app level module which depends on filters, and services | |
var alApp = angular.module('alApp', | |
[ | |
... | |
, 'login' | |
... | |
] | |
) | |
.constant('loginRedirectPath', '/signin') | |
... | |
.constant('DEFAULTPICTURE', 'anonym.png') | |
.service('initApp',['$rootScope', 'loginService', 'FBURL', 'AWAY', 'IDLE', 'DEFAULTPICTURE', | |
function($rootScope, loginService, FBURL, AWAY, IDLE, DEFAULTPICTURE) { | |
var runInit = function() { | |
$rootScope.FBURL = FBURL; | |
$rootScope.IDLE = IDLE; | |
$rootScope.AWAY = AWAY; | |
$rootScope.DEFAULTPICTURE = DEFAULTPICTURE; | |
$rootScope.auth = loginService.init(); | |
}; | |
return { | |
run: runInit | |
} | |
} | |
]) | |
.run(['initApp', | |
function(initApp) { | |
initApp.run(); | |
}]) | |
AND THIS IS A INIT FUNCTION IN loginService from login module | |
init: function() { | |
return auth = $firebaseSimpleLogin(firebaseRef()); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment