Use angular.forEach for looping.