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');
});
沒有運氣。最後一個打破鉻說消化已經運行。