Using Isotope with AngularJS (ng-repeat)

后端 未结 2 1889
甜味超标
甜味超标 2020-12-24 00:33

I\'m trying to use angular to load div\'s to supply to isotope for layouting. For some reason, I can\'t use ng-repeat to create the div\'s. When I do something like, it wo

2条回答
  •  盖世英雄少女心
    2020-12-24 01:00

    Try $watching the list variable (cards), and whenever it changes re-apply the isotope. I think your problem is isotope is running before the ng-repeat is filled in.

    Quick example:

    scope.$watch(attrs.ngModel, function() {
      elm.isotope();
    });
    

提交回复
热议问题