0
How to get the id of the button clicked on a result listing line by Angular JS?
In the HTML page I can use list.id, but in the code in Angularjs, the codes below return 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();
});