ReferenceError:" x"没有定义

时间:2017-06-01 09:12:50

标签: angularjs

var app = angular.module('myApp', []);

app.controller('SigninController', function ($scope, $http) {

  $scope.postdata = function (email, password, deviceRegistrationId) {<br>
    var data = {<br>
      email: "tarun@pixilogic1.com",<br>
      password: "gpmce@123",<br>
      deviceRegistrationId: "dJ8foF4Fo8E:APA91bECJA4B7GivMIbdfrypr3p1TaJTGuKTsucK4TF8abVsecxNK22eqUXXh4zvqrrOziyuITqn4L4Lrr4hRPfZ4Wt9ksQ-trZecdYoxaBb3r3mX31vEgp6KfrBfs-c6I5jGuk5wZSO"<br>
    };<br>
    var url = "http://freedoctor.southeastasia.cloudapp.azure.com/auth/signin"<br>
    $http.post(url, JSON.stringify(data)).<br>
    success(function (response) {<br>
        $scope.msg = response;<br>
        console.log($scope.msg);<br>
    }, <br>
    function (response) {<br>
      $scope.msg = "Service not Exists";<br>
      $scope.statusval = response.status;<br>
      $scope.statustext = response.statusText;<br>
      $scope.headers = response.headers();<br>
    });<br>
  };<br>
}); <br>

这里没有引用,我找不到

1 个答案:

答案 0 :(得分:1)

我认为您的$ scope和$ http没有注入。

试试这个:

var app = angular.module('myApp', []);



app.controller('SigninController', SigninController);

SigninController.$inject = ['$scope','$http'];

function SigninController($scope, $http){

....

}