MCPcopy Create free account
hub / github.com/angular/components / redirect

Function redirect

docs/src/app/routes.ts:102–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100 // Typed explicitly, because `canActivate` also accepts deprecated class-based guards. Any function
101 // matches that type as well, so an inline guard wouldn't have its return value type checked.
102 const redirect: CanActivateFn = () => {
103 window.location.href = typeof target === 'string' ? target : target();
104 return false;
105 };
106
107 return {
108 // The router requires a `component`.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected