Replace angular.forEach with native loop