-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
PR #34381 improves ExpressionChangedAfterChecked error by adding property name for property bindings and also the content of the entire property interpolation. There are few more things that we can improve:
-
for attribute bindings and interpolations, include attribute name and the entire expression (similar to property bindings and interpolations). Implemented in PR feat(ivy): improveExpressionChangedAfterCheckederror message for attributes #34505. -
for text interpolations (like. Implemented in PR feat(ivy): improveSome exp {{ exp1 }} and {{ exp2 }}), we can store metadata intView.dataand display the whole block when we throw an error (making sure we limit the length of the output from interpolation)ExpressionChangedAfterCheckederror message for text interpolations #34520. -
when expression value is an object, the.[Object object]is printed, we canJSON.stringifyit (or smth similar) and limit it to 1000 chars or so -
for i18n attributes (like
<div i18n-title title="Some exp {{ exp1 }}"></div>) we can extract property name from i18n metadata (stored intView.data, but using a different format). Currently property name for such cases are not be included intoExpressionChangedAfterCheckederror. -
Include component's name into the error message, so that it's easier to find the template where the problem happened. Implemented in refactor(core): ImproveExpressionChangedAfterItHasBeenCheckedError#50286. -
Consider including an expression that caused the problem (should work for text interpolations at least). However this is not trivial, since it'd require changes to the generated code and including the
ngDevModeflag, so that this extra debug info doesn't make it into prod bundles.