ExpressionChangedAfterItHasBeenCheckedException

export class ExpressionChangedAfterItHasBeenCheckedException

exported from angular2/core defined in angular2/src/core/change_detection/exceptions.ts (line 1)

An error thrown if application changes model breaking the top-down data flow.

This exception is only thrown in dev mode.

Example

@Component({ selector: 'parent', template: ` <child [prop]="parentProp"></child> `, directives: [forwardRef(() => Child)] }) class Parent { parentProp = "init"; } @Directive({selector: 'child', inputs: ['prop']}) class Child { constructor(public parent: Parent) {} set prop(v) { // this updates the parent property, which is disallowed during change detection // this will result in ExpressionChangedAfterItHasBeenCheckedException this.parent.parentProp = "updated"; } }

Constructor

constructor(exp: string, oldValue: any, currValue: any, context: any)

Not Yet Documented