@@ -11,6 +11,7 @@ import {RuntimeError, RuntimeErrorCode} from '../errors';
1111import { Type } from '../interface/type' ;
1212
1313import { getComponentDef } from './definition' ;
14+ import { getDeclarationComponentDef } from './instructions/element_validation' ;
1415import { TNode } from './interfaces/node' ;
1516import { LView , TVIEW } from './interfaces/view' ;
1617import { INTERPOLATION_DELIMITER } from './util/misc_utils' ;
@@ -52,11 +53,15 @@ export function throwMultipleComponentError(
5253
5354/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
5455export function throwErrorIfNoChangesMode (
55- creationMode : boolean , oldValue : any , currValue : any , propName ?: string ) : never {
56+ creationMode : boolean , oldValue : any , currValue : any , propName : string | undefined ,
57+ lView : LView ) : never {
58+ const hostComponentDef = getDeclarationComponentDef ( lView ) ;
59+ const componentClassName = hostComponentDef ?. type ?. name ;
5660 const field = propName ? ` for '${ propName } '` : '' ;
5761 let msg =
5862 `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${
59- field } : '${ oldValue } '. Current value: '${ currValue } '.`;
63+ field } : '${ oldValue } '. Current value: '${ currValue } '.${
64+ componentClassName ? ` Expression location: ${ componentClassName } component` : '' } `;
6065 if ( creationMode ) {
6166 msg +=
6267 ` It seems like the view has been created after its parent and its children have been dirty checked.` +
0 commit comments