I have a JSON object, represented as such:
{
\"orders\" : [
{
\"ordernum\" : \"PRAAA000000177800601\",
\"buyer\" : \"Donna Heywood\"
Actually its same answer of @sylwester. The better way to put it in filter. And you can reuse it by passing propertyName parameter.
In your case we passed parcels
JS
myApp.filter('createarray', function () {
return function (value, propertyName) {
var arrayList = [];
angular.forEach(value, function (val) {
angular.forEach(val[propertyName], function (v) {
arrayList.push(v)
});
});
return arrayList;
}
});
HTML
- {{o.upid}}
Here is working Fiddle