使用命令构建角度应用程序时出现以下错误ng build --prod
。
错误:
edit.component.html(111,50): Property 'controls' does not exist on type 'AbstractControl'.
edit.component.html(113,54): Property 'controls' does not exist on type 'AbstractControl'
我在下面解释我的代码。
<div *ngIf="storeForm.get('Address').controls['AddressLine1'].invalid && (storeForm.get('Address').controls['AddressLine1'].dirty || storeForm.get('Address').controls['AddressLine1'].touched)"
class="alert alert-danger">
<div *ngIf="storeForm.get('Address').controls['AddressLine1'].errors.required">
AddressLine1 is required.
</div>
</div>
this.storeForm = this.fb.group({
Address: this.fb.group({
AddressLine1: ['', Validators.required],
}),
});
我需要在构建应用程序时忽略这些警告消息,并且我正在使用Angular cli-8.2.1
.