2
I need to get the account id that is displayed in the html below. And I need to take this id to my backend and bring the dice and edit, but I’m not getting it.
Follows my codes:
<div class="col-md-6 tabelaEntradas" ng-controller="EditarContaCtrl">
<table width="400">
<tr>
<th>Subcategoria</th>
<th>Conta</th>
<th>Editar</th>
</tr>
<tr ng-repeat="contaE in contasEntrada">
<td>{{contaE.subcategoria}}</td>
<td>{{contaE.conta}}</td>
<td><a href="#/editarConta/{{contaE.idconta}}">editar</a></td>
</tr>
</table>
</div>
my controller:
app.controller("EditarContaCtrl", function ($scope, $http, $window, $routeParams) {
var idempresa = $window.localStorage.getItem('idemp');
var empresa = $window.localStorage.getItem('empresa');
var usuario = $window.localStorage.getItem('usuario');
var idusuario = $window.localStorage.getItem('idusuario');
$scope.empresa = empresa;
$scope.usuario = usuario;
var pegarContaEntrada = function(contaE){
console.log(contaE);
}
pegarContaEntrada();
});
All right, I’ll try.
– GustavoSevero
James and if in addition to clicking the button I want to go to another screen where the editing data should appear?
– GustavoSevero
Didn’t work out...
– GustavoSevero
You have $Location. https://docs.angularjs.org/guide/$Location here
– Tiago Bértolo