Is there a way to dynamically bind the response data to the HTML generated inside ng-repeat?
Currently, only socialCount is being bound for all li's.
Check out this snippet of my HTML code:
<li ng-repeat="category in inbox.categories track by $index">
<a href="#">
<div class="left-row" ng-click="inbox.showView(category)" target="_self">
<div class="leftcolumn1"><span class="glyphicon glyphicon-user"></span></div>
<div class="leftcolumn2">{{category}}</div>
<div class="leftcolumn3 email-time" ng-bind="inbox.messageCounts.socialCount"></div>
</div>
</a>
</li>
The server responds with this data:
{"socialCount":431,"promotionsCount":17843,"updatesCount":26997,"forumsCount":1780}
This is the JavaScript function I am using:
Inbox.prototype.getMessageCounts = function(categories){
$http.get(
this.messageCountUrl + this.userGuid).success(function(data){
this.messageCounts=data;
}.bind(this));