2017-06-01 1 views
0
var app = angular.module('myApp', []); 

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

    $scope.postdata = function (email, password, deviceRegistrationId) {<br> 
    var data = {<br> 
     email: "[email protected]",<br> 
     password: "[email protected]",<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> 

definiert Was nicht hier Bezug genommen wird, ich kann es nicht findenReference: „x“ ist nicht

+0

was
Tag in JS zu tun? – anoop

Antwort

1

ich denke Ihren $ Umfang und http $ nicht injizierte.

Try this:

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



app.controller('SigninController', SigninController); 

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

function SigninController($scope, $http){ 

.... 

} 
Verwandte Themen