Angular 13 - get an exterior template component inside another component's code
I want to fetch dynamically by injecting data into an outer component and getting the html result into a variable in my seed code
getTable() {
let table : any = [];
console.log('table',this.events);
this.events.forEach((value,index) => {
console.log(value,index);
let ddd = formatDate(value.date_arrivee, 'short','fr-Fr','Paris') as string;
let fff = formatDate(value.date_depart, 'short','fr-Fr','Paris') as string;
let d = { 'Début' : ddd,
'Fin' : fff,
'Lieu' : value.communaute.nom_cte,
'Retraite' : value.retraite.titre_retraite,
'Public' : value.formulaire.tpublic.tpublic,
'Nombre' : value.nb,
'Statut' : value.etat.etat} ;
table.push(d);
});
console.log(table);
console.log('etat', this.etat);
}
How to use @ViewChild in this setup ?
'Statut' : <app-statut [event]="value"\></app-statut\>
I will like to put the result of the outer component in my variable using @ViewChild or another decorator