Angular表单提交IE9

时间:2015-12-07 05:02:25

标签: angularjs angular-ui-router internet-explorer-9

我正在构建一个角度应用程序,要求用户在表单中登录。 此表单适用于Chrome和Firefox,但不适用于IE9。

html表单提交:

<button  class="btn  btn-theme-bg btn-lg" ng-click="!form.$invalid?login():null"  ng-disabled="loading">Log in&nbsp;&nbsp;<i ng-show="loading" class="fa fa-spinner fa-spin"></i></button>

控制器:

$scope.login = function(){
        $scope.loading = true;
        $scope.doShake = false;
        $scope.invalidCredentials = false;
        userRestService.login($scope.user).$promise.then(function(client){
            console.log('login ok');
            sharedDataService.setCurrentClient(client);
            $rootScope.$broadcast('userLoggedIn');
            $state.go('root.dashboard.list');

        }).catch(function(){
            $scope.attemptCount = $scope.attemptCount+1;
            if($scope.attemptCount>1){$scope.doShake = true;};
            $scope.loading = false;
            $scope.user.password = '';
            $scope.passwordError = false;
            $scope.invalidCredentials = true;
        });
    };

在IE9上,提交后,API通过HTTP POST以正确的参数进行定位,并按预期工作,并在返回用户确定后,路由错误,登录名和密码在URL中以明文形式显示在#:

之前

http://localhost:3000/?email=test@test.com&password=test#/home

知道什么可能只会导致IE9中出现此错误吗?

0 个答案:

没有答案