jose luis garcia cespedes jose luis garcia cespedes - 1 year ago 133
AngularJS Question

Show/Hide TR Angular

I have two

as in the example below, I need to add a button on the first
when pressed to show / hide the TR son.

Can somebody help me.

<tr ng-repeat-start="categoria in vm.categorias track by">
<!-- content -->
<tr ng-repeat-end ng-repeat="categoriaAux in categoria.hijos track by">
<!-- content -->

Answer Source

Here's a working fiddle

    <tr ng-repeat-start="categoria in vm.categorias">
       <td>categoria {{}}</td>
         <button type="button" ng-click="showCategoria = !showCategoria">Show/Hide</button>
    <tr ng-hide="showCategoria" ng-repeat-end ng-repeat="categoriaAux in categoria.hijos">
       <td>categoriaAux: {{categoriaAux}}</td>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download