I'm getting data from my backend server
proyecto: Proyecto;
ngOnInit(): void {
// subscribe START
this.route.paramMap.subscribe(
params => {
const id = params.get('id');
console.log('MainContent:Proyecto Seleccionado: ', id);
this.dataService.getDatosCabeceraProyecto(id)
.subscribe(
(data: Proyecto) => this.proyecto = data,
(err: any) => console.log(err),
() => console.log('MainContent: datos de proyecto recogidos')
);
});
// subscribe END
}
But If I use ngIf directive I don't see anything
But I get the data
Any idea Please? Thanks
Try checking with some data inside the result with *ngIf and see if u get the results first.
For eg -
*ngIf="proyecto.ID==X000128"
This will give you an idea of what it accepts.
Use can use this and check as example
<div *ngIf="!!proyecto">
reference use of !! Operator
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.