Remove window.app

This commit is contained in:
Amos Haviv
2013-11-22 03:37:48 +02:00
parent eeb54232a9
commit db5684636b
4 changed files with 15 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
window.app = angular.module('mean', ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles']);
angular.module('mean', ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles']);
angular.module('mean.system', []);
angular.module('mean.articles', []);

View File

@@ -1,5 +1,5 @@
//Setting up route
window.app.config(['$routeProvider',
angular.module('mean').config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/articles', {
@@ -24,7 +24,7 @@ window.app.config(['$routeProvider',
]);
//Setting HTML5 Location Mode
window.app.config(['$locationProvider',
angular.module('mean').config(['$locationProvider',
function($locationProvider) {
$locationProvider.hashPrefix("!");
}

View File

@@ -1,15 +1,7 @@
window.bootstrap = function() {
angular.bootstrap(document, ['mean']);
};
window.init = function() {
window.bootstrap();
};
angular.element(document).ready(function() {
//Fixing facebook bug with redirect
if (window.location.hash == "#_=_") window.location.hash = "";
//Then init the app
window.init();
angular.bootstrap(document, ['mean']);
});

View File

@@ -1,9 +1,12 @@
angular.module('mean.system').factory("Global", [function() {
var _this = this;
_this._data = {
user: window.user,
authenticated: !! window.user
};
//Global service for global variables
angular.module('mean.system').factory("Global", [
function() {
var _this = this;
_this._data = {
user: window.user,
authenticated: !! window.user
};
return _this._data;
}]);
return _this._data;
}
]);