diff --git a/public/js/app.js b/public/js/app.js index a69b8d6761..99c0b1bfdb 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -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', []); \ No newline at end of file diff --git a/public/js/config.js b/public/js/config.js index dc6ca36945..25000cadf8 100644 --- a/public/js/config.js +++ b/public/js/config.js @@ -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("!"); } diff --git a/public/js/init.js b/public/js/init.js index f77b4f2ae1..2246d15211 100644 --- a/public/js/init.js +++ b/public/js/init.js @@ -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']); }); \ No newline at end of file diff --git a/public/js/services/global.js b/public/js/services/global.js index 95eb0117a0..93071aa474 100644 --- a/public/js/services/global.js +++ b/public/js/services/global.js @@ -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; -}]); \ No newline at end of file + return _this._data; + } +]);