loonison101
10/26/2015 - 11:41 PM

flatten_data.js

var data = [
  { refNum: 'a1', items: [{name: 'item 1'}, {name: 'item 2'}] },
  { refNum: 'b4', items: [{name: 'item 3'}, {name: 'item 4'}] }
];

var items = [];

$scope.$watch('data',function ( nv, ov ) {
  angular.forEach(nv, function ( item ) {
    items.push(item);
  });
});

// ng-repeat in html over items