class ManagedParentChangeEvent

extends ManagedCoreEvent

Event that is emitted when a managed object is assigned to a managed child reference property (see @managedChild decorator); the child object emits this event, with parent set to the new parent object.


The following example shows how this event can be observed on a component (or other managed object).

class MyChildComponent extends Component { }

// observe the event on the above class:
MyChildComponent.observe(class {
  onManagedParentChange(e: ManagedParentChangeEvent) {
    if (e.parent instanceof MyParentComponent) {
      console.log("New parent: " +;

class MyParentComponent extends Component {
  constructor (public readonly foo: string) {

  // this is a managed child property so assigning
  // a component here triggers the event
  foo = new MyChildComponent();

let c = new MyChildComponent();
let a = new MyParentComponent("a"); = c;  // => New parent: a
let b = new MyParentComponent("b"); = c;  // => New parent: b


(parent: ManagedObject): ManagedParentChangeEvent



The new parent object.



Inherited from


(): Readonly<this>

Inherited from ManagedEvent.freeze.