Currently, am storing my data in cookies and passing it via ajax call to fetch data from the server.
So, currently my webapp is specific to single client machine and url is not sharable. So I want to pass request params to dynamically generate url to fetch and update the data from my node server.
How can I generate links like the below one and pass it as part of $http service in angular to fetch data from node express.
Current code:
AngularJS $http.post('/getPropertyData',data).success(function(data,status) { $scope.parseData(data); }); .state('listProperties', { url:'/listProperties', templateUrl : 'list.html', controller : 'listControl' })
Node Backend:
router.post('/',function(req,res) {
var finalResp = [];
var asyncIterator = 0;
MongoClient.connect(url, function(err, db) {
...........
function sendResponse(asyncIterator,length,finalResp,db) {
if(asyncIterator==length) {
res.send(finalResp);
db.close();
}
}
}