I have this code,
idTirada: string;
tirada: Tirada;
constructor(private tiradaService: TiradaService,
private route: ActivatedRoute ) {
this.idTirada = this.route.snapshot.paramMap.get('id');
this.tiradaService.getTirada( this.idTirada )
.subscribe( resp => {
this.tirada = resp;
console.log (resp)
});
}
I read Firebase with tiraradaService and it returns an array with the information
{arc: "-M9TuPty-oGAmgmnh0WL", camp: "massia", data: "2020-06-14T09:47:32.878Z", plens: "0", punts: "135", …}
I show it in the HTML
<ion-card-header>
<ion-card-subtitle>{{ tirada.arc }}</ion-card-subtitle>
</ion-card-header>
But it gives me this error, that if I refresh the information several times it disappears, it is as if I loaded the HTML before the data and did not know where to get the information
core.js:6228 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'arc' of undefined