0
我已经得到了以下代码,可以在android上运行,iphone上的chrome和桌面上的safari上运行正常,但是它在iPhone上无法运行。该页面永远不会改变,我使用警报来确定它的所有工作,直到$ location.path部分。
.success(function(data, status, headers, config) {
stopLoading();
console.log(data);
if (data.Resp.startsWith("E")) {
alert(checkErrorCodes(data.Resp));
} else if (data.Resp === "OK") {
localStorage.setItem("SessionKey", data.SessionKey);
localStorage.setItem("Username", $scope.loginUsername);
$scope.username = localStorage.getItem('Username');
$location.path('/index');
}
从阅读网上我也试过:
$location.path('/index');
$scope.apply();
和
$timeout(function() {
$location.path('/index');
})
和
$scope.$apply(function() {
$location.path('/index');
});
没有运气。最后一个打破铬说消化已经运行。