use angular.forEach to iterate over array