I’m working in an angular application, and I’m getting the following error:
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ng-untouched: true'. Current value: 'ng-untouched: false’.
I have an input field that looks like this:
<input matInput type="text" [(ngModel)]="description" #descriptionInput />
{{ descriptionInput.focus() }}
My component looks like this:
@Component({
selector: 'app-watermelon-dialog',
templateUrl: './watermelon-dialog.component.html',
styleUrls: ['./watermelon-dialog.component.scss']
})
export class WatermelonDialogComponent extends GeneralDialogComponent implements OnInit {
public description : string;
constructor(
public dialogRef: MatDialogRef<GeneralDialogComponent>,
@Inject(MAT_DIALOG_DATA) public dialogData: GeneralDialogModel,
ngDynFormService: DynamicFormService,
public generalDialogService: GeneralDialogService) {
super(dialogRef,
dialogData,
ngDynFormService,
generalDialogService);
}
ngOnInit() {
this.description = this.dialogData.extra;
}
}
Does anyone know why I’m get that error? And how can I get rid of it? Thanks.