I'm trying to make a table, where it shows the list of requests and the button for editing
Order Lita:
var lista = [
{id: 1, nome: 'Pedido 1', ano1: 100, ano2: 200},
{id: 2, nome: 'Pedido 2', ano1: 100, ano2: 200},
{id: 3, nome: 'Pedido 3', ano1: 100, ano2: 200},
{id: 4, nome: 'Pedido 4', ano1: 100, ano2: 200},
{id: 5, nome: 'Pedido 5', ano1: 100, ano2: 200}
];
When you click on the Edit button, you will see the inputs with the same modulo of the values shown in the table, which are not initially hidden, to make changes
How can I do this function to show and hide inputs?
I thought of adding a property editando
to request, but since this property is not any data from the request, I wanted to know if there is any way to do this, without adding modal property
<table class="table">
<tr>
<td>
<input type="checkbox" ng-click="selecionarTudo($event, lista)">
</td>
<td>Nome</td>
<td>Ano 1</td>
<td>Ano 2</td>
<td>Ação</td>
</tr>
<tr ng-repeat="pedido in selecionado" ng-click="tableCheck($event, pep)">
<td>
<input type="checkbox" ng-model="pedido.selected">
</td>
<td>{{pedido.nome}}</td>
<td>
{{pedido.ano1 | currency | real}}
<input type="text" ng-model="pedido.ano1">
</td>
<td>
{{pedido.ano2 | currency | real}}
<input type="text" ng-model="pedido.ano2">
</td>
<td>
<button class="btn">Editar</button>
</td>
</tr>
</table>