Angularjs. ng-switch not working inside a table -
is there anyway can ng-switch working inside table? table example not working ul exampel work fine. problem need table example. using angular 1.07.
<table> <tbody ng-repeat="item in items"> <tr><td>{{ item.heading }}</td></tr> <tr ng-repeat="row in item.fields" ng-switch on="row.nb"> <div ng-switch-when="01"> <td>{{ row.nb }}</td> </div> </tr> </tbody> </table> <ul ng-repeat="item in items"> <li ng-repeat="row in item.fields" ng-switch on="row.nb"> <div ng-switch-when="01"> {{ row.nb }} </div> </li> </ul>
you need move ng-switch-when td otherwise ignore invalid because div not valid markup inside tr. https://developer.mozilla.org/en-us/docs/web/html/element/tr
remove div , change to:
<td ng-switch-when="01">{{ row.nb }}</td>
Comments
Post a Comment