javascript - Angular $http Promises and callbacks not firing -


i'm trying callback function fire after angular $http post i'm having no luck. post function working, not callback. see on angular's site .success() has been deprecated i'm trying .then() doesnt seem either.

can please tell me i'm missing? thank in advance.

starwarsapp.controller('appcontroller', ['$scope', '$http','$q', function($scope, $http,$q) {       $scope.addcontact = function(){         $http.post('/jedilist',$scope.jedientered).then(function(response){             console.log('why not being seen?');         });      };  }]); 

thank helped. omg realized what's wrong. never stopped server connection in express 'res.end(), $http.post never finishing call callback. i've spent last day agonizing on js promises realize now.

so code works fine. having similar issue, make sure node and/or express connections being ended res.end().

$scope.addcontact = function(){     $http.post('/jedilist',$scope.jedientered).then(function(response){         console.log('now being seen!');     });  }; 

Comments