1

I am new to Angular.

I am trying to redirect from the current page to another page based on the response from API.

The redirection is happening but the code is not working correctly in IE browser but is working fine in Chrome.

Could someone please help why this error occurs?

Error in IE console:

Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!

SCRIPT5022: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations:

JS file:

app.config(function($routeProvider){   $routeProvider
        .when('/findCustomer', {
           templateUrl: 'CustomerList.html',
           controller: 'customerListController',
        })
        .when('/modifyCustomer', {
           templateUrl: 'ModifyCustomer.html',
           controller: 'modifyController',
        })

Customer list Controller:

service.getCustomerList().then(function(data) {
        if (data.length == 1) {
            $window.location.href= "#/modifyCustomer";
        }
firstpostcommenter
  • 2,328
  • 4
  • 30
  • 59

1 Answers1

0

Thanks Poger

The issue is resolved in IE as well.

I have used $location.path("/modifyCustomer"); instead of $window.location.href= "#/modifyCustomer";

Note: If I use window.location.href before calling POST, then the page redirection is successful in IE as well....which is why I am not able to figure out the issue

firstpostcommenter
  • 2,328
  • 4
  • 30
  • 59