1

What's wrong here?

template:

<drr-person (isMinorEmittor)="setPersonIsMinor($event)" [group]="requesterForm" [required]="true" ></drr-person>

ts:

ngOnInit() {

    if (!this.required)
        this.personForm.addControl("nationalnumber", this.fb.control("", [Validators.minLength(11)]));
    else
        this.personForm.addControl("nationalnumber", this.fb.control("", [Validators.required, Validators.minLength(11)]));

}

Throws:

EXCEPTION: Error in ... caused by: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.

user2963570
  • 381
  • 6
  • 21
  • 1
    Possible duplicate of [Expression \_\_\_ has changed after it was checked](http://stackoverflow.com/questions/34364880/expression-has-changed-after-it-was-checked) – Christopher Moore Jan 16 '17 at 11:11

0 Answers0