How to use the @angular/router.NavigationError function in @angular/router

To help you get started, we’ve selected a few @angular/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FINRAOS / herd-ui / src / testing / router-stubs.ts View on Github external
emitError(id: number = 1, url: string = 'testUrl.com/test', error: string = 'Test Error') {
    this.eventsSubject.next(new NavigationError(this.id, url, error));
  }
github ngxs / store / packages / router-plugin / src / router.state.ts View on Github external
private dispatchRouterError(event: NavigationError): void {
    this.dispatchRouterAction(
      new RouterError(
        this._routerState!,
        this._storeState,
        new NavigationError(event.id, event.url, `${event}`),
        this._trigger
      )
    );
  }
github ionic-team / ionic / packages / angular / src / router / monkey-patch-router.ts View on Github external
(e: any) => {
          if (isNavigationCancelingError(e)) {
            router.navigated = true;
            router.resetStateAndUrl(storedState, storedUrl, rawUrl);
            (router.events as Subject)
                .next(new NavigationCancel(id, router.serializeUrl(url), e.message));

            resolvePromise(false);
          } else {
            router.resetStateAndUrl(storedState, storedUrl, rawUrl);
            (router.events as Subject)
                .next(new NavigationError(id, router.serializeUrl(url), e));
            try {
              resolvePromise(router.errorHandler(e));
            } catch (ee) {
              rejectPromise(ee);
            }
          }
        });
github ngrx / platform / modules / router-store / src / router_store_module.ts View on Github external
private dispatchRouterError(event: NavigationError): void {
    this.dispatchRouterAction(ROUTER_ERROR, {
      storeState: this.storeState,
      event: new NavigationError(event.id, event.url, `${event}`),
    });
  }