Q:

Create mailto hyperlink using AngularJS ng-repeat

I'm currently printing out our user list using ng-repeat.
<div ng-repeat="User in ac.Users | filter:ac.Search | limitTo:ac.Limit"
     style="{{ac.Users.indexOf(User)%2 == 0  ? 'background-color:#f2f2f2' : 'background-color:white' }};">
  <span style="font-weight:600;">{{User.FullName}}</span>
  <span style="font-weight:600;">{{User.EmailAddress}}</span>
</div>

I was wondering is there anyway I can create single mailto: hyperlink adding all of the users email.
<a href="mailto:user1@email.com,user2@email.com,user3@email.com.....">Group Mail</a>

A:

In the controller:
var arr = $filter('filter')($scope.ac.Users, $scope.ac.Search);
arr.length = $scope.ac.limit;
var emailArr = arr.map(_ => _.MailAddress);
$scope.mailRef = "mailto:" + emailArr.join(",");

HTML
<a href="{{mailRef}}">Group Mail</a>

