iterate messages i with ng-repeat in template after making array from messages