angularjs - getting only values from json data -


i making http request /result json data . data in format

[{"name":"first","total":830,"passed":678,"failed":152}]} 

here's angularjs script-

analyzer.controller('checkvalue',function($scope,$http)         {                     $scope.cases = [];             $http.get('/result').success(                             function(data) {                                 $scope.cases = data.responsedata;                                 });                  }); 

it doesn't work has key , value in data.how can values ?

you can try:

$scope.cases = object.keys(data.responsedata).map(function (key) {     return data.responsedata[key]; }); 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -