当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - $route.reload() is not working in IE

问题描述:

I am using AngularJs to build application. In IE, data is not getting refreshed, even after calling $route.reload(). But it is working fine in other browsers. Even I have test it different system, still I'm facing same issue.

Here is the code

Service.methodname(data1)

.success(function (data, status, header, config) {

$scope.response = data;

$('#mySchedulElection').modal('hide');

if (data == 1) {

$scope.showmessage('Election successfully saved', $scope.MessageType.success);

$route.reload();

}

}

});

Thanks in advance.

网友答案:

Check your cache policy in Service. By default AngularJs will cache your requests. Try using

$http.get('url', {cache: false});

Maybe it is a better idea to create a Cache object for this request to better control of the cache behavior.

$http.get('url', {cache: serviceCache});

and then you can invalidate the cache when you need it:

serviceCache.removeAll();

See

https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache

for more info

分享给朋友:
您可能感兴趣的文章:
随机阅读: