Skip to content

Commit 7736c5b

Browse files
Fixat "infinit loop" problem i IE11 med hjälp härifrån: angular/angular.js#1417 (comment)
1 parent 44cd368 commit 7736c5b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

statistik-web/src/main/webapp/js/app/controller/business/businessLandingPageCtrl.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@
1919

2020
'use strict';
2121

22-
angular.module('StatisticsApp').controller('businessLandingPageCtrl', ['$scope', '$window', '$cookies', 'statisticsData',
23-
function ($scope, $window, $cookies, statisticsData) {
22+
angular.module('StatisticsApp').controller('businessLandingPageCtrl', ['$scope', '$location', '$cookies', 'statisticsData',
23+
function ($scope, $location, $cookies, statisticsData) {
2424

2525
statisticsData.getLoginInfo(function (loginInfo) {
2626
if (loginInfo.businesses.length < 1) {
27-
$window.location.href = "#/login";
27+
$location.path("login");
28+
} else {
29+
$location.path("verksamhet/" + loginInfo.defaultVerksamhet.vardgivarId + "/oversikt");
2830
}
29-
$window.location.href = "#/verksamhet/" + loginInfo.defaultVerksamhet.vardgivarId + "/oversikt";
3031
}, function () {
3132
$scope.dataLoadingError = true;
3233
});
3334

3435
}
35-
]);
36+
]);

statistik-web/src/main/webapp/js/app/controller/pageCtrl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ angular.module('StatisticsApp').controller('pageCtrl', [ '$scope', '$rootScope',
6666
$scope.isLoggedIn = $rootScope.isLoggedIn;
6767

6868
$scope.loginClicked = function (url) {
69-
$window.location.href = "#/" + url;
69+
$location.path(url);
7070
};
7171

7272
}

0 commit comments

Comments
 (0)