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

Method constructor

packages/router/src/create_url_tree.ts:244–265  ·  view source on GitHub ↗
(
    public isAbsolute: boolean,
    public numberOfDoubleDots: number,
    public commands: readonly any[],
  )

Source from the content-addressed store, hash-verified

242
243class Navigation {
244 constructor(
245 public isAbsolute: boolean,
246 public numberOfDoubleDots: number,
247 public commands: readonly any[],
248 ) {
249 if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
250 throw new RuntimeError(
251 RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS,
252 (typeof ngDevMode === 'undefined' || ngDevMode) &&
253 'Root segment cannot have matrix parameters',
254 );
255 }
256
257 const cmdWithOutlet = commands.find(isCommandWithOutlets);
258 if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
259 throw new RuntimeError(
260 RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND,
261 (typeof ngDevMode === 'undefined' || ngDevMode) &&
262 '{outlets:{}} has to be the last command',
263 );
264 }
265 }
266
267 public toRoot(): boolean {
268 return this.isAbsolute && this.commands.length === 1 && this.commands[0] == '/';

Callers

nothing calls this directly

Calls 3

lastFunction · 0.90
isMatrixParamsFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected