I had a JSON response as below
{"items":["1","2","3"],"code":"ok"}
var simpleArry = [] ;
$http.post(url, "", "")
.then(function (response) {
console.log(response.data.items);
//$scope.items= response.data.items;
//instead of the above line
simpleArry = resp.data.items;
});
I need the array to iterate again to get some data from another call . need it in a list/array which it should look like
var itmsArry = ["1","2","3"]
I tried something like this
var simpleArry = [] ;
simpleArry = resp.data.items;
but it always empty . What went wrong with it
My Question was not duplicate . Its about the json array and nothing to do with async call