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
Bug: Data binding that references the isActive property of a MatTab results in an ExpressionChangedAfterItHasBeenCheckedError on the initial load of the app, and every time one navigates to or away from the tab for which the value is being used.
The error appears on the initial load and when switching tabs.
To repro you need a mat-tab-group with two or more tabs, and another component which has a property referencing the isActive property of one of the tabs:
This results in the error: "Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'myProperty: false'. Current value: 'myProperty: true'"
This initial error can be fixed by waiting for the MatTabGroup to be initialized before binding to myProperty, but the error also happens when navigating between tabs.
The text was updated successfully, but these errors were encountered:
* Fixes a "changed after checked" error being thrown if the consumer is using the `isActive` property of a tab somewhere in the view.
* Reworks the `MatTab` to only have one `stateChanges` subject rather than one per property.
Fixesangular#12197.
crisbeto
added
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
has pr
labels
Jul 14, 2018
Hi. Thanks for making the PR! I was wondering if there is any update on this? This is blocking us from writing tests for our components with tabs, since the ExpressionChangedAfterItHasBeenCheckedError causes tests to fail. Happy to help in any way I can.
…12206)
* Fixes a "changed after checked" error being thrown if the consumer is using the `isActive` property of a tab somewhere in the view.
* Reworks the `MatTab` to only have one `stateChanges` subject rather than one per property.
Fixes#12197.
…12206)
* Fixes a "changed after checked" error being thrown if the consumer is using the `isActive` property of a tab somewhere in the view.
* Reworks the `MatTab` to only have one `stateChanges` subject rather than one per property.
Fixes#12197.
Bug, feature request, or proposal:
Bug: Data binding that references the isActive property of a MatTab results in an ExpressionChangedAfterItHasBeenCheckedError on the initial load of the app, and every time one navigates to or away from the tab for which the value is being used.
What are the steps to reproduce?
Here's a stackblitz that reproduces the issue:
https://angular-issue-tabs-expressionchangedafterithasbeenchecked.stackblitz.io
The error appears on the initial load and when switching tabs.
To repro you need a mat-tab-group with two or more tabs, and another component which has a property referencing the isActive property of one of the tabs:
<mat-tab-group>
<mat-tab #firstTab [label]="'Tab 1'">
<div class="content"></div>
</mat-tab>
<mat-tab [label]="'Tab 2'">
<div class="content"></div>
</mat-tab>
</mat-tab-group>
<foo-component [myProperty]="firstTab.isActive"></foo-component>
This results in the error: "Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'myProperty: false'. Current value: 'myProperty: true'"
This initial error can be fixed by waiting for the MatTabGroup to be initialized before binding to myProperty, but the error also happens when navigating between tabs.
The text was updated successfully, but these errors were encountered: