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

Method constructor

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

Source from the content-addressed store, hash-verified

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