{"record":{"id":"bc1ae855273fc45e","repo":"angular/angular","slug":"expression-changed-after-checked","errorCode":"EXPRESSION_CHANGED_AFTER_CHECKED","errorMessage":"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for '${propName}': '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.","messagePattern":"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked\\. Previous value for '(.+?)': '(.+?)'\\. Current value: '(.+?)'\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/render3/errors.ts","lineNumber":85,"sourceCode":"  oldValue: any,\n  currValue: any,\n  propName: string | undefined,\n  lView: LView,\n): never {\n  const hostComponentDef = getDeclarationComponentDef(lView);\n  const componentClassName = hostComponentDef?.type?.name;\n  const field = propName ? ` for '${propName}'` : '';\n  let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(\n    oldValue,\n  )}'. Current value: '${formatValue(currValue)}'.${\n    componentClassName ? ` Expression location: ${componentClassName} component` : ''\n  }`;\n  if (creationMode) {\n    msg +=\n      ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n      ` Has it been created in a change detection hook?`;\n  }\n  throw new RuntimeError(RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED, msg);\n}\n\nfunction formatValue(value: unknown): string {\n  let strValue: string = String(value);\n\n  // JSON.stringify will throw on circular references\n  try {\n    if (Array.isArray(value) || strValue === '[object Object]') {\n      strValue = JSON.stringify(value);\n    }\n  } catch (error) {}\n  return strValue.length > VALUE_STRING_LENGTH_LIMIT\n    ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…'\n    : strValue;\n}\n\nfunction constructDetailsForInterpolation(\n  lView: LView,","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/core/src/render3/errors.ts#L67-L103","documentation":"Error \"ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for '${propName}': '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.\" thrown in angular/angular.","triggerScenarios":"Thrown at packages/core/src/render3/errors.ts:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the bound value before change detection (e.g. in ngOnInit) or defer the update with setTimeout/signals."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}