Remove references to $rootScope.Shared & .Content in non-view code.

Instead, have them request services that return them so tests don’t need to prepare special state.
This commit is contained in:
Andrew Bloomgarden
2014-01-12 15:05:15 -08:00
parent 77801e458e
commit dc368bb652
14 changed files with 65 additions and 58 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
"use strict";
habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$http', '$state', 'Guide',
function($rootScope, $scope, $location, User, $http, $state, Guide) {
habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$http', '$state', 'Guide', 'Shared',
function($rootScope, $scope, $location, User, $http, $state, Guide, Shared) {
$scope.profile = User.user;
$scope.profile.petCount = $rootScope.Shared.countPets(null, $scope.profile.items.pets);
$scope.profile.petCount = Shared.countPets(null, $scope.profile.items.pets);
$scope.hideUserAvatar = function() {
$(".userAvatar").hide();
};
@@ -25,7 +25,7 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
User.user.ops.changeClass({query:{class:klass}});
$scope.selectedClass = undefined;
$rootScope.Shared.updateStore(User.user);
Shared.updateStore(User.user);
$state.go('options.profile.stats');
window.setTimeout(Guide.classesTour, 10);
}