angular - 我无法在视图中获取 id
问题描述
我们有两个具有关系的“需求”和“企业”类OneToMany
。我想展示每一个需求者的企业。
API 有效,但问题出在前面。
企业服务:
getDemandeEntreprisebyId(id)
{
this.http.get(this.rootURL + '/Entreprise/EntrepriseByDemande/'+id)
.toPromise()
.then(res => this.listDemandeEntreprise = res as Entreprise[]);
}
看法 :
<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>
解决方案
推荐阅读
- javascript - React:如果调用了函数,如何重新渲染
- maven - Java 11 + maven + lombok + spring boot 项目返回 Can't extract module name from xpp3_min-1.1.4c
- django - Django将表单中的数据过滤到另一个视图
- android - 应用程序未显示在 Android 虚拟设备中
- python - 遗传算法 - 继承问题
- r - ggadjustedcurves 错误:必须在“[”中使用向量,而不是类矩阵的对象
- python - 如何获取字典列表中唯一值的计数?
- java - 使用新的
(新的 (文件名)) - shopify - Shopify 如果标签不包含
- command-line-arguments - 在pytest中,选项字符串'-xvvv'是什么意思