update method

void update(
  1. void run(
    1. C instance
    )
)

Runs run to apply changes to the component instance.

After the callback runs, it will trigger change detection and any corresponding lifecycle events.

Note that if instance implements AfterChanges, the lifecycle event will be triggered regardless of whether any inputs actually changed or not.

Implementation

void update(void Function(C instance) run) {
  final ngZone = injector.provideType<NgZone>(NgZone);
  ngZone.runGuarded(() {
    final component = _component;
    run(component);
    if (component is AfterChanges) {
      component.ngAfterChanges();
    }
    _hostView.componentView.markForCheck();
  });
}