You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nb-option ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'setDisabled: false'. Current value: 'setDisabled: true'.
#1210
Closed
jagabs opened this issue
Feb 2, 2019
· 2 comments
· Fixed by #1329
I had the same problem. There are some problems with destroying elements like nb-select and nb-checkbox because of value in control changes after nb-select destroyed. You can temporary change this.cd.detectChanges() in select.component.js on if(!this.cd['destroyed']) { this.cd.detectChanges(); }
Thanks for reporting! Fix is planned for 3.4.2 (PR #1329).
For now you can prevent error by recreating control instead of setting new value.
Something like this:
if (value === 'Payment') {
this.transactionForm.removeControl('paymentMethod');
this.transactionForm.addControl('paymentMethod', new FormControl('Cash', Validators.required));
} else {
this.transactionForm.removeControl('paymentMethod');
this.transactionForm.addControl('paymentMethod', new FormControl(null));
}
When i change the type to payment the first time, no error. Change to Loan and to payment again it gives me this error.
The text was updated successfully, but these errors were encountered: