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

This exception is only thrown in dev mode.

<!-- TODO: Add a link once the dev mode option is configurable -->

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";
  }
}
Inheritance
  • Object
  • Error
  • BaseException
  • ExpressionChangedAfterItHasBeenCheckedException

Constructors

ExpressionChangedAfterItHasBeenCheckedException(oldValue, currValue, context)

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
message → String

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
stackTrace → StackTrace

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited