Performance wise, is it better to pass individual objects to a directive like so
<div ng-repeat="user in users">
<user-info user="user"></user-info>
</div>
// user-info directive
<div>
<span>{{ user.username }}</span><br>
<span>{{ user.email }}</span>
</div>
Or pass the entire array to a single directive:
<user-list users="users"></user-list>
// user-list directive
<div ng-repeat="user in users">
<span>{{ user.username }}</span><br>
<span>{{ user.email }}</span>
</div>
I imagine the second option would be a better idea since the directive's methods wouldn't get called for every item in the array
Thanks for any input!