MCPcopy Create free account
hub / github.com/angular/angular / shouldTriggerDeferBlock

Function shouldTriggerDeferBlock

packages/core/src/defer/rendering.ts:509–522  ·  view source on GitHub ↗
(triggerType: TriggerType, lView: LView)

Source from the content-addressed store, hash-verified

507 * Determines whether we should proceed with triggering a given defer block.
508 */
509export function shouldTriggerDeferBlock(triggerType: TriggerType, lView: LView): boolean {
510 // prevents triggering regular triggers when on the server.
511 if (triggerType === TriggerType.Regular && typeof ngServerMode !== 'undefined' && ngServerMode) {
512 return false;
513 }
514
515 // prevents triggering in the case of a test run with manual defer block configuration.
516 const injector = lView[INJECTOR];
517 const config = injector.get(DEFER_BLOCK_CONFIG, null, {optional: true});
518 if (config?.behavior === DeferBlockBehavior.Manual) {
519 return false;
520 }
521 return true;
522}

Callers 3

registerDomTriggerFunction · 0.90
scheduleDelayedTriggerFunction · 0.90
triggerDeferBlockFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected