Using ng-repeat and ng-class in directive template

2019-07-31 04:47发布

I have a directive that turns a collection of items into a variable number of columns. The template for the directive uses ng-repeat to repeat the columns, and ng-class to apply a css class that turns the div into a column. The problem is angular throws errors when using the ng-class on same line as ng-repeat. Removing it fixes the issue, but the directive doesnt work properly. Now, this same functionality works fine in normal angular views, but not when used in a directive template.

Here is a plunkr i put together to demonstrate: http://plnkr.co/edit/MKAbQR?p=preview

0条回答
登录 后发表回答