rewrite: add back in bulid-safe angular DI

This commit is contained in:
Tyler Renelle 2013-08-28 00:28:50 -04:00
parent e355627bf0
commit e641fe9cf1
6 changed files with 17 additions and 13 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ config.json
npm-debug.log
lib
public/bower_components
builtAssets/
src/*/*.js
src/*/*.map

View file

@ -4,7 +4,8 @@
The authentication controller (login & facebook)
*/
habitrpg.controller("AuthCtrl", function($scope, $rootScope, Facebook, LocalAuth, User, $http, $location, API_URL) {
habitrpg.controller("AuthCtrl", ['$scope', '$rootScope', 'Facebook', 'LocalAuth', 'User', '$http', '$location', 'API_URL',
function($scope, $rootScope, Facebook, LocalAuth, User, $http, $location, API_URL) {
var runAuth;
var showedFacebookMessage;
$scope.useUUID = false;
@ -65,4 +66,4 @@ habitrpg.controller("AuthCtrl", function($scope, $rootScope, Facebook, LocalAuth
});
}
};
});
}]);

View file

@ -3,7 +3,8 @@
/* Make user and settings available for everyone through root scope.
*/
habitrpg.controller("RootCtrl", function($scope, $rootScope, $location, User) {
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User',
function($scope, $rootScope, $location, User) {
$rootScope.modals = {};
$rootScope.User = User;
$rootScope.user = User.user;
@ -35,4 +36,4 @@ habitrpg.controller("RootCtrl", function($scope, $rootScope, $location, User) {
$rootScope.set('flags.newStuff',false);
}
});
}]);

View file

@ -1,6 +1,7 @@
"use strict";
habitrpg.controller("TaskDetailsCtrl", function($scope, $rootScope, $location, User) {
habitrpg.controller("TaskDetailsCtrl", ['$scope', '$rootScope', '$location', 'User',
function($scope, $rootScope, $location, User) {
$scope.save = function(task) {
var log, setVal;
setVal = function(k, v) {
@ -54,4 +55,4 @@ habitrpg.controller("TaskDetailsCtrl", function($scope, $rootScope, $location, U
$scope.editedTask = null;
$scope.editing = false;
};
});
}]);

View file

@ -1,6 +1,7 @@
"use strict";
habitrpg.controller("TasksCtrl", function($scope, $rootScope, $location, User, Algos, Helpers, Notification) {
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', 'Algos', 'Helpers', 'Notification',
function($scope, $rootScope, $location, User, Algos, Helpers, Notification) {
/*FIXME
*/
$scope.taskLists = [
@ -152,4 +153,4 @@ habitrpg.controller("TasksCtrl", function($scope, $rootScope, $location, User, A
});
}
};
});
}]);

View file

@ -1,17 +1,16 @@
"use strict";
habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter, User) {
debugger
habitrpg.controller("UserAvatarCtrl", ['$scope', '$location', 'User',
function($scope, $location, User) {
$scope.profile = User.user;
$scope.hideUserAvatar = function() {
$(".userAvatar").hide();
};
$scope.clickAvatar = function(profile) {
debugger
if (User.user.id == profile.id) {
if ($location.path() == '/tasks') {
$location.path('/options')
$location.path('/options');
} else {
$location.path('/tasks');
}
@ -20,4 +19,4 @@ habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter,
//$("#avatar-modal-#{uid}").modal('show')
}
}
});
}]);