Hello, I’ve been testing the Collection repeat directive in order to improve rendering performance.
However, It seems that the ng-init Is not working as expected:
<div class="item"
collection-repeat="post in posts"
collection-item-width="'100%'"
collection-item-height="getPostHeight(post)">
<div ng-controller="PostCtrl" ng-init="register(post)">
{{post.description}}
</div>
</div>
Then, my register fuction in the PostCtrl controller:
$scope.register = function(post)
{
console.log(post)
}
That function works with the ng-repeat directive, however, when using the collection-repeat directive, the register function will output “undefined” to the console
Am I doing something wrong? Thanks in advance!