AngularJS Http Post没有回归成功

时间:2017-06-20 10:23:31

标签: angularjs rest

这是将数据发送到Rest的服务,其余的返回StatusText =" OK"



$scope.login = function() {
    alert("Scope'a girdi...");
    AuthenticationService.Login($scope.username, $scope.password, function(response) {
        if (response.success) {
            AuthenticationService.SetCredentials($scope.username, $scope.password);
            $location.path('/admin');
        } else {
            $scope.error = response.message;
            console.log("Response not success");
        }
    });




结束这是带回调的句柄的控制器



{{1}}




然而,代码neve进入成功功能。

1 个答案:

答案 0 :(得分:0)

将您的控制器更改为

http://192.168.1.5:8000/24hrcares/signin

由于您要返回状态文本,因此无需再次检查response.success