Skip to content

Instantly share code, notes, and snippets.

@EnchanterIO
Created April 23, 2014 13:10
Show Gist options
  • Save EnchanterIO/11214651 to your computer and use it in GitHub Desktop.
Save EnchanterIO/11214651 to your computer and use it in GitHub Desktop.
App
'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