Reputation: 4127
So I have a scope function below that returns uniqueUsers. If I want to output the text in HTML using ng-repeat, how do I go about doing this?
// update filter functions
$scope.updateFilter = function (start, end) {
// console.log(start.unix());
thisMonthUsers = [];
records.forEach(function (entry) {
var entryStart = entry.f[3].__text / 1000;
var entryEnd = entry.f[4].__text / 1000;
if (!(entryEnd < start.unix() || entryStart > end.unix())) {
thisMonthUsers.push(entry.f[1].__text);
}
});
var uniqueUsers = thisMonthUsers.filter(Unique); // unique
return uniqueUsers;
}
So far I have tried this but it doesn't work:
<div class="panel-body">
<ul>
<li ng-repeat="uniqueUsers in updateFilter">{{ uniqueUsers() }}</li>
</ul>
</div>
Upvotes: 0
Views: 47
Reputation: 1286
Following code could do the trick:
<div class="panel-body">
<ul>
<li ng-repeat="user in users = uniqueUsers() | filter">...</li>
</ul>
</div>
Upvotes: 1