How to get the button id clicked on a row of result listings by Angular JS?
In the HTML page I can use list.id, but in the code in AngularJS, the following code returns me undefined :
id;
$scope.id;
$scope.listagensRelatorios.id;
$scope.parametro.id;
$routeParams.id
app.controller("listagemRelatoriosController", function($scope, $http, $location, $q) {
$scope.listagensRelatorios = [];
$scope.listagemRelatorio = {};
carregarListagemRelatorios = function() {
$http({
method : 'GET',
url : 'http://localhost:8080/listagemRelatorios',
}).then(function(response) {
$scope.listagensRelatorios = response.data;
}, function(response) {
console.log(response.data);
console.log(response.status);
});
};
gerarRelatorioSelecionado = function() {
$http({
method : 'GET',
url : 'http://localhost:8080/listagemRelatorios' + $scope.listagensRelatorios.id,
}).then(function(response) {
$scope.listagensRelatorios = response.data;
}, function(response) {
console.log(response.data);
console.log(response.status);
});
};
carregarListagemRelatorios();
gerarRelatorioSelecionado();
});