angular - 使用字符串插值显示对象的特定属性
问题描述
我需要通过字符串插值显示一个属性,但它不起作用。似乎一切都很好,但我不知道为什么它不起作用。此外,@Inputed()
从父组件到子组件的对象。
<mat-panel-description>
{{personnelEvaluationList.maxPoint}}
<mat-icon color="primary">timeline</mat-icon>
</mat-panel-description>
和 ts 父代码是:
personnelEvaluationList: PersonnelEvaluation[] = [];
getEvaluationPersonnel(req: PersonnelEvaluationRequest) {
this.isLoading = true;
this.route.queryParamMap.subscribe(r => {
this.personnelDetailApiService
.getEvaluationPersonnel(req)
.subscribe(res => {
this.personnelEvaluationList = (res.result);
this.isLoading = false;
},
catchError((err) => {
this.snackBar.open('', null, {
duration: 5000
});
return throwError(err);
})
);
});
}
并且evaluationPersonnelList
输入到孩子,这是孩子的ts文件
@Input() personnelEvaluationList: PersonnelEvaluation;
这是父模板
<app-personnel-details-list [personnelProfile]='personnelProfile'
[personnelEvaluationList]='personnelEvaluationList'
[personnelVoiceOfCustomersList]='personnelVoiceOfCustomersList'
[personnelAssessmentList]='personnelAssessmentList'>
</app-personnel-details-list>
解决方案
推荐阅读
- solr - Solr 备份在指定位置时不起作用
- python - 熊猫,复制具有多个值的每一行
- swift - 无法将“NSImageInterpolation.Type”类型的值转换为预期的参数类型“[NSImageRep.HintKey: Any]?”
- discord.js - 如何将变量放入参数中?
- ruby-on-rails - Rails - 使用 2 个模型按日期范围过滤
- ios - 关于有限查询参考的 keepSynced(true) 的一些问题
- node.js - Nodemon 不工作:[nodemon] 由于更改而重新启动
- javascript - 在 TypeScript 中使用 createStyles 证明内容
- nginx - (Nginx Windows) nginx: [emerg] 未知指令“serversupstream”
- swift - xib 的大小是否符合内容?