Using limitTo in directive with ng-repeat removes all my items from the DOM

118 views Asked by At

I'm building an angularJS app. I've many data to retrieve from an array of json objects, and I've to limit the number of those data, and I want to use limitTo to perform that.

I use ng-repeat inside a directive like below :

<my-directive
    ng-repeat="unConteneur in conteneurs | limitTo: 10"
    ng-show="(unConteneur.libelle_rubrique==rubriqueCourante || unConteneur.nom==rubriqueCourante) && hideSearch"
    contenu="unConteneur">
</my-directive>

But putting limitTo, removes all my items from the DOM. My code work properly when I remove limitTo. And I don't know why!

I imported angular and all other libraries correctly.

Where I'm wrong?

0

There are 0 answers