I have the following code in my http Service(UserService):
module1.factory('UserService', ['$http', '$q', function($http, $q) {
return {
getModelValueTableValues1: function(CarLine, GeographyType, GeographyName, Duration, ModelId, ScenarioId, TimeKey) {
return $http.get('http://localhost:8080/scenarioplan/models/data?ScenarioId=5&CarLine=Nissan%20-%20Rogue&TimeKey=Jul-16&Duration=1&Geographytype=National&GeographyName=National&ModelId=1001')
.then(
function successCallback(response) {
return response.data;
},
function errorCallback(errResponse) {
console.error('Error while fetching Model Parameter Table');
return $q.reject(errResponse);
}
);
},
ANd I have the following code in my controller:
$scope.getModelValueTableValues = function(CarLine, Geography, Duration, ModelId, ScenarioId) {
UserService.getModelValueTableValues1(CarLine, Geography.split('-')[0], Geography.split('-')[1], Duration, ModelId, ScenarioId, '16-Jul')
.then(
function(d) {
console.log("the data object from promise is", d);
console.log("the data object from promise is", d.length);
console.log('The Promise has been successfully resolved!!!!');
},
function(errResponse) {
console.error('The Promise was not successfull');
}
);
};
But instead of returning an array of data, the promise, after getting resolved gives an array of objects as shown by the image below in my debug window(F12).

The reponse from Web Service Call seems to valid Data as shown by F12 Console Output below:
Can someone please help me to resolve this issue?? I have been trying to solve this throughout the day but without any success!

responsehas ?http://localhost:8080/scenarioplan/models/data?ScenarioId=5&CarLine=Nissan%20-%20Rogue&TimeKey=Jul-16&Duration=1&Geographytype=National&GeographyName=National&ModelId=1001what does this url returnarray of datacan you explain this a bit more.