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

Method constructor

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

Source from the content-addressed store, hash-verified

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