Using ng-repeat and ng-class in directive template causes an unknown error

余生长醉 提交于 2019-12-11 12:05:28

问题


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

来源:https://stackoverflow.com/questions/18237106/using-ng-repeat-and-ng-class-in-directive-template-causes-an-unknown-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!