We have two classes "demande" and "entreprise" with a relation OneToMany
. I would like to show every demande's entreprise.
The API works but the problem is on the front.
The entreprise's service :
getDemandeEntreprisebyId(id)
{
this.http.get(this.rootURL + '/Entreprise/EntrepriseByDemande/'+id)
.toPromise()
.then(res => this.listDemandeEntreprise = res as Entreprise[]);
}
View :
<tr *ngFor="let sd of serviceDemande.list" >
<td (click)="populateForm(pd)">{{pd.dateDemande | date : 'dd/MM/yyyy'}}</td>
<td (click)="populateForm(pd)">{{pd.typeDemande}}</td>
<td *ngFor="let e of serviceEntreprise.getDemandeEntreprisebyId(sd.idDemande)">{{e.nomEntreprise}}</td>
</tr>