AngularJS possible unhandled rejection when using ui-router

前端 未结 4 539
深忆病人
深忆病人 2020-12-16 02:25

After I have changed from ngRoute to angular-ui-router the console shows always 4 errors stating: Possibly unhandled rejection: {}

I did not noticed

4条回答
  •  轮回少年
    2020-12-16 02:53

    I used the next solution

        $http.get('/api/get').then(function(result) {
           // ... stuff here
        }).catch(angular.noop);
    

    it's equals to

    $http.get('/api/get').then(function(result) {
      // ... stuff here
    }).catch(function(){});
    

提交回复
热议问题