angularjs - How to pass data from $http.get to request body in angular -
i using express , angular app.
suppose have following factory:
angular.module('liveapp.factory',[]) .factory('datafactory', ['$http', datafactory]) function datafactory($http){ var datafactory = {}; datafactory.checkdb = function(){ return $http({ method: 'get', url: '/artistsearch', data: "need data go request body" }) } return datafacory; }
and on server side have:
app.js
app.get('/artistsearch',dbhelpers.checkdbartist)
dbhelpers.js
exports.checkdbartist = function(req,res,next){ var newartist = req.body; }
for reason when checkdb invoked request not passing on data
req.body in checkdbartist
. request body evaluates {}
. have idea why?
Comments
Post a Comment