jose luis garcia cespedes jose luis garcia cespedes - 5 months ago 61
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 -->


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>