• 개요
@angular/core

BootstrapOptions

인터페이스
사용 중단 권고v20.2부터

Provides additional options to the bootstrapping process.

사용 중단을 권고합니다.

Configure NgZone in the providers array of the application module instead.

API

    
      interface BootstrapOptions {}
    
    

ngZone

NgZone | "zone.js" | "noop" | undefined
@deprecated

BootstrapOptions is deprecated. Provide NgZone in the providers array of the module instead.

Optionally specify which NgZone should be used when not configured in the providers.

  • Provide your own NgZone instance.
  • zone.js - Use default NgZone which requires Zone.js.
  • noop - Use NoopNgZone which does nothing.

ngZoneEventCoalescing

boolean | undefined
@deprecated

BootstrapOptions is deprecated. Use provideZoneChangeDetection instead to configure coalescing.

Optionally specify coalescing event change detections or not. Consider the following case.

<div (click)="doSomething()">
  <button (click)="doSomethingElse()"></button>
</div>

When button is clicked, because of the event bubbling, both event handlers will be called and 2 change detections will be triggered. We can coalesce such kind of events to only trigger change detection only once.

By default, this option will be false. So the events will not be coalesced and the change detection will be triggered multiple times. And if this option be set to true, the change detection will be triggered async by scheduling a animation frame. So in the case above, the change detection will only be triggered once.

ngZoneRunCoalescing

boolean | undefined
@deprecated

BootstrapOptions is deprecated. Use provideZoneChangeDetection instead to configure coalescing.

Optionally specify if NgZone#run() method invocations should be coalesced into a single change detection.

Consider the following case.

for (let i = 0; i < 10; i ++) {
  ngZone.run(() => {
    // do something
  });
}

This case triggers the change detection multiple times. With ngZoneRunCoalescing options, all change detections in an event loop trigger only once. In addition, the change detection executes in requestAnimation.

상세 내용으로 이동