저장을 클릭하면 문제가 발생합니다. 오류 메시지 "Object.eval [as updateDirectives]에서 null의 '필수'속성을 읽을 수 없습니다."
이것은 내 코드 html
<form name="dataForm" [formGroup]="dataForm" (ngSubmit)="onSubmit()">
<div class="mb-24" fxLayout="row" fxLayoutAlign="start start" [ngClass]="{'has-error': ((dataForm.get('usernames').touched ||
dataForm.get('usernames').dirty) &&
dataForm.get('usernames').errors)}">
<mat-form-field fxFlex>
<input matInput placeholder=" Username" formControlName="usernames">
<mat-error *ngIf="((dataForm.get('usernames').touched ||
dataForm.get('usernames').dirty) &&
dataForm.get('usernames').errors).required">
Username empty
</mat-error>
</mat-form-field>
</div>
이 버튼
<button mat-raised-button class="save-button mat-accent" type="submit" (click)="showToaster()"
[mat-dialog-close] [disabled]="dataForm.errors.required? true: null">Save</button>
간단히 할 수 있습니다 [disabled]="!dataForm.valid"
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다