I have a $http get method which should invoke my local server. I am getting proper response from my server through postman. Following is my Json values:
[{"id":27885,"bslRef":acms.2016.04.00,"size":0,"isDefault":true,"baselineDate":null,"parentRef":null,"activities":null,"default":true,"open":true,"daily":false}]
As "bslRef":acms.2016.04.00
which is the value I am interested in is not enclosed in a json tag [""].
That is why i am getting an parsing error. This is the error I am getting from jsonlint.
Error: Parse error on line 3:
...: 27885, "bslRef": acms .2016 .04 .00,
----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
Following is my angularjs controller code:
$http.get('/baseline/getBaseline?', {params: {
currProject: $scope.selectedProject}})
.success(function(data) {
$scope.baselines=JSON.stringify(data);
})
.error(function(data) {
alert("failure");
});
I have tried with parse() method and stringify() method but of no use.
My server side application is a spring-mvc rest application, which is giving me proper response, But in the said format.
Please some one help me either parse this through angular methods, or get me a json type response from my spring controller. TIA.