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> 

demo: http://plnkr.co/edit/yhkbgekjggdts8pntekj?p=preview


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -