【发布时间】:2017-05-05 09:10:20
【问题描述】:
在使用 Angular 4.1.1 启用 strictNullChecks 后,null 检查出现多个错误。我已经修复了它们的捆绑包,但无法为 this.form.get('username').value 修复相同的 Object is possibly 'null'。与其他人一样,我也尝试过相同的方法,但无法修复错误。
if (this.form.get('username') != null) {
body.append('username', this.form.get('username').value);
}
【问题讨论】:
标签: angular typescript2.0