基本上我有一个关系数据
educational_awards
并且有一个字段
award
我试图将这些数据显示到我的html表中,但它不会显示。
<tr *ngFor="let item of data; let i = index">
<td>
{{ item.year }}
</td>
<td>
{{ item.course }}
</td>
<td>
{{ item.educational_awards.award }}
</td>
</tr>
export interface IUserEducationalBackground {
id: number;
user_id: number;
studies_type: string;
year: number;
course: string;
educational_awards?: EducationalAward ;
}
interface EducationalAward {
id?: number;
award?: string;
}
我做得对还是完全错了。对angular来说相当陌生,所以我很困惑。