js: compatible with angular 1.6

This commit is contained in:
nemunaire 2017-12-14 03:20:38 +01:00
commit 6047dcd6a9
3 changed files with 45 additions and 39 deletions

View file

@ -15,7 +15,8 @@ angular.module("FICApp")
var initTime = function() {
$timeout.cancel($scope.cbi);
$scope.cbi = $timeout(initTime, 10000);
$http.get("/time.json").success(function(time) {
$http.get("/time.json").then(function(response) {
var time = response.data;
console.log("upd time");
time.he = (new Date()).getTime();
sessionStorage.userService = angular.toJson(time);
@ -126,11 +127,11 @@ angular.module("FICApp")
$scope.my = response.data;
});
$http.get("/stats.json").success(function(stats) {
$scope.stats = stats;
$http.get("/stats.json").then(function(response) {
$scope.stats = response.data;
});
$http.get("/settings.json").success(function(settings) {
$scope.settings = settings;
$http.get("/settings.json").then(function(response) {
$scope.settings = response.data;
});
$http.get("/themes.json").then(function(response) {
if ($scope.lastthemeetag == response.headers().etag)
@ -175,7 +176,7 @@ angular.module("FICApp")
})
.controller("TeamController", function($scope, $http, $interval) {
$scope.mystats = null;
$http.get("/api/teams/" + $scope.team.id + "/stats.json").success(function(mstats) {
$scope.mystats = mstats;
$http.get("/api/teams/" + $scope.team.id + "/stats.json").then(function(response) {
$scope.mystats = response.data;
});
});