angular - Generate a child route and send parameters by url data from a table by pressing a <a> element -
i trying send url parameters belonging row of table, happen when click on display option, general idea of result of process following: localhost / 4200 / lista_documentos / viewpdf / title: code: date: state
component.ts viewpdf;
import { component, oninit } '@angular/core'; import { router, activatedroute, params } '@angular/router'; @component({ selector: 'app-view-pdf', templateurl: './view-pdf.component.html', styleurls: ['./view-pdf.component.css'] }) export class viewpdfcomponent implements oninit { constructor( private route: activatedroute, private router: router ) { } ngoninit() { let id = this.route.snapshot.params['id']; let fecha = this.route.snapshot.params['fecha']; let estado = this.route.snapshot.params['estado']; let codigo = this.route.snapshot.params['codigo']; } }
<div id="panellistado" class="panel panel-default"> <div id="bodylistado" class="panel-body"> <h3>listado de minutas, actas, informes</h3> <hr> <div id="overflowagenda"> <div id="tableagenda" class="divtable"> <div class="divtablebody"> <div id="headertable" class="divtablerow"> <div class="divtablecell"> titulo </div> <div class="divtablecell"> codigo </div> <div class="divtablecell"> fecha </div> <div class="divtablecell"> estado </div> <div class="divtablecell"> visualizar </div> </div> <div class="divtablerow" *ngfor="let item of lista"> <div class="divtablecell"> {{ item.tituloinforme }} </div> <div class="divtablecell"> {{ item.id_informe }} </div> <div class="divtablecell"> {{ item.fechainforme }} </div> <div class="divtablecell"> {{ item.estado }} </div> <div class="divtablecell"><a routerlink="/viewpdf" >visualizar</a></div> </div> </div> </div> </div> </div> </div>
]3
Comments
Post a Comment