when i submit signup form using postman it works fine, but when i try to submit using the below code it shows some error, im unable to figure it out, anyone please help me?
.controller('RegisterCtrl', function($scope, AuthService, $state, $http) {
$scope.user = {
name: '',
mobile:'',
email:'',
password:''
};
$scope.signup = function() {
$http.post("http://localhost:8080/api/signup", $scope.user, {headers: {'Content-Type': 'application/json'} })
.then(function (response) {
return response;
});
};
})
when i inspect chrome browser it logs the below error:
angular.js:14362 Error: Unexpected request: POST http://localhost:8080/api/signup
No more request expected
at $httpBackend (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-mocks.js:1402:9)
at sendReq (http://localhost:3000/bower_components/angular/angular.js:12178:9)
at serverRequest (http://localhost:3000/bower_components/angular/angular.js:11930:16)
at processQueue (http://localhost:3000/bower_components/angular/angular.js:16689:37)
at http://localhost:3000/bower_components/angular/angular.js:16733:27
at Scope.$eval (http://localhost:3000/bower_components/angular/angular.js:18017:28)
at Scope.$digest (http://localhost:3000/bower_components/angular/angular.js:17827:31)
at ChildScope.$apply (http://localhost:3000/bower_components/angular/angular.js:18125:24)
at HTMLInputElement.<anonymous> (http://localhost:3000/bower_components/angular/angular.js:26813:23)
at HTMLInputElement.dispatch (http://localhost:3000/bower_components/jquery/dist/jquery.js:4435:9) Possibly unhandled rejection: {}(anonymous function) @ angular.js:14362(anonymous function) @ angular.js:10859processChecks @ angular.js:16715$eval @ angular.js:18017$digest @ angular.js:17827$apply @ angular.js:18125(anonymous function) @ angular.js:26813dispatch @ jquery.js:4435elemData.handle @ jquery.js:4121