Angular directive with ng-repeat, ng-show “Show more” and lazy-load

后端 未结 1 1813
耶瑟儿~
耶瑟儿~ 2020-12-15 08:54

I use this directive, iterating over an array \"myArr\", filtering for a few conditions.



        
1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 09:27

    Use ng-if instead of ng-show.

    Unlike ng-show, falsey ng-if removes the element from the DOM.

    EDIT:

    Also, you can, in fact, use limitTo filter, which would make your code much cleaner:

    plunker

    0 讨论(0)
提交回复
热议问题