问题
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