Just change
`<span ng-init="likeCount=feed.likes.length">{{likeCount}}</span>`
per
`<span>{{feed.likes.length}}</span>`.
If you still need a counter in the controller for some other reason (which I don’t see), create a controller, let's say FeedCtrland add it to your article:
<article ng-repeat="feed in feeds" ng-controller="FeedCtrl">
...
<span>{{likeCount}}</span>
</article>
And your FeedCtrl will be:
function FeedCtrl($scope) {
$scope.$watch('feed.likes.length', function(newValue) {
$scope.likeCount = newValue;
});
}
:
<article ng-repeat="feed in feeds" ng-controller="FeedCtrl">
...
<span>{{likeCount()}}</span>
</article>
function FeedCtrl($scope) {
$scope.likeCount = function() {
return $feed && $feed.likes ? $feed.likes.length : undefined;
};
}