I’m new to node and angular script. I’m having a function readDetails within my service which gives a GET request.
this.readDetails = function() {
return $http({
method: 'GET',
url: '/getDetails'
}).then(function(data) {
return data;
});
}
Given below is my server side code.
app.get('/getDetails', function(request, response) {
fs.readFile('details.json', 'utf8', function(err, data) {
if (err) throw err;
var obj = JSON.parse(data);
response.send(obj);
response.end();
})
})
I don’t get the response from the server. I do not find Why. Suggestions are welcome
Source: AngularJS
from Angular Questions https://angularquestions.com/2017/09/28/http-get-is-not-giving-response/
via @lzomedia #developer #freelance #web
No comments:
Post a Comment