forked from dsjoerg/ggtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecon_stats.js
More file actions
26 lines (22 loc) · 765 Bytes
/
econ_stats.js
File metadata and controls
26 lines (22 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
gg.controller('EconomyStatsController', ['$scope', '$element', '$urlFilter', 'EconStats',
function ($scope, $element, $urlFilter, EconStats) {
$scope.race = 'protoss';
$scope.vs_race = 'zerg';
$scope.leagues = [0,1,2,3,4,5,6];
$scope.filter = $urlFilter;
$scope.unit = null;
$scope.es = new EconStats.get({});
$scope.filter.defaults = {
race: 'protoss',
vs_race: 'zerg',
}
$scope.filter.onChange = function(){
$scope.filter.apply($scope);
}
$scope.$watch('race + vs_race', function(v) {
$scope.filter.params.race = $scope.race;
$scope.filter.params.vs_race = $scope.vs_race;
$scope.key = $scope.race[0].toUpperCase() + 'v' + $scope.vs_race[0].toUpperCase();
});
}
]);