angular - 角度类型“未定义”不可分配给类型
问题描述
我不明白这里的问题。我必须使用 temp var,因为它会导致代码的其他部分出现问题。
public orgTemp: any = null;
public orgList!: Array <Organization>;
errors:
this.api.ListOrganizations().then(event => {
this.orgList = event.items;
works:
this.api.ListOrganizations().then(event => {
this.orgTemp = event.items;
this.orgList = this.orgTemp;
解决方案
推荐阅读
- spring-boot - Spring Boot 应用程序无法连接到 Docker 中的 Redis 副本
- asp.net - HEREAPI 地图不显示在 asp.net MVC 中
- python - Change Magento password account from Python script
- html - Checkbox does not hide a div
- node.js - If any Promise is rejected, how do you count the number of success in Promise.all?
- mysql - MySQL 选择在 %i:%s 中返回 '%H:%i:%s' 持续时间,其中 %i 也占 %H
- github - 防止 (.md) 文件中的换行符
- angular - Angular 路由器,在现有 url 上运行
- java - 升级 android studio 破坏了我的颤振构建(macOS)
- python - 将 h5 文件加载到 pytorch