MCPcopy Index your code
hub / github.com/angular/angular / canMatch

Method canMatch

packages/router/test/integration/guards.spec.ts:2193–2200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2191 class DelayedGuard {
2192 static delayedExecutions = 0;
2193 canMatch() {
2194 return of(true).pipe(
2195 switchMap((v) => new Promise((r) => setTimeout(r, 10)).then(() => v)),
2196 tap(() => {
2197 DelayedGuard.delayedExecutions++;
2198 }),
2199 );
2200 }
2201 }
2202 const router = TestBed.inject(Router);
2203 const delayedGuardSpy = spyOn(TestBed.inject(DelayedGuard), 'canMatch');

Callers

nothing calls this directly

Calls 2

setTimeoutFunction · 0.85
thenMethod · 0.65

Tested by

no test coverage detected