Hi I am developing Angularjs application and getting some data from Web API. I am able to receive data. I can confirm this because i can see in fiddler and browser developer tool as well. Below is my code. I am returning data as json from web api. I am returning below object.
return Request.CreateResponse(HttpStatusCode.OK, obj);
Object obj contains some fields(data);
In browser i can see response as below.
{"ID":11,"project_id":1,"levels":1,"icon":1,"description":1,"summary":1,"output":1,"owner":1,"role":1,"objectives":1,"reporting":1,"performance_indicators":1,"success":0,"Created":"0001-01-01T00:00:00","Updated":"0001-01-01T00:00:00"}
This is my angular code.
var saveSubs = ProjectSetting_Service.AddProcessSettings(sub);
saveSubs.then(function (data) {
alert((data.data));
alert((data.obj));
}, function (error) {
})
This is my service.js code
this.AddProcessSettings = function (sub) {
$http.post('/api/NCT_ProcessSettings/', sub).success(function (response) { alert(response); });
}
In alert i want to see response data. May i get some help? Any help would be appreciated. Thank you.
alert. Should beconsole.log.data? It looks to me likedatadoesn't contain a propertydata