An AngularJS Iterator Pattern implementation