Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Remove window.app
Browse files Browse the repository at this point in the history
  • Loading branch information
Amos Haviv authored and Amos Haviv committed Nov 22, 2013
1 parent eeb5423 commit db56846
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
@@ -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', []);
4 changes: 2 additions & 2 deletions public/js/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//Setting up route
window.app.config(['$routeProvider',
angular.module('mean').config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/articles', {
Expand All @@ -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("!");
}
Expand Down
10 changes: 1 addition & 9 deletions public/js/init.js
Original file line number Diff line number Diff line change
@@ -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']);
});
19 changes: 11 additions & 8 deletions public/js/services/global.js
Original file line number Diff line number Diff line change
@@ -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;
}
]);

0 comments on commit db56846

Please sign in to comment.