How to use the @ngxs/router-plugin.Navigate function in @ngxs/router-plugin

To help you get started, we’ve selected a few @ngxs/router-plugin 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 xlayers / xlayers / src / app / upload / upload.component.ts View on Github external
async onFileSelected(file: File) {
    try {
      const data = await this.sketchService.loadSketchFile(file);
      this.isDragging$.next(false);
      // Note: these actions need to be run in sequence!
      this.store.dispatch([
        new ResetUiSettings(),
        new CurrentData(data),
        new Navigate(['/editor/preview'])
      ]);
    } catch (error) {
      this.store.dispatch(new InformUser(error, ErrorType.Runtime));
      throw error;
    }
  }
github abpframework / abp / npm / ng-packs / dist / theme-basic / esm5 / lib / components / application-layout / application-layout.component.js View on Github external
function () {
        this.oauthService.logOut();
        this.store.dispatch(new Navigate(['/'], null, {
            state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
        }));
        this.store.dispatch(new GetAppConfiguration());
    };
    // required for dynamic component
github ngxs / ngxs-examples / timekeeper / src / app / auth / auth.state.ts View on Github external
onLoginRedirect(ctx: StateContext) {
    console.log('onLoginRedirect, navigating to /auth/login');
    ctx.dispatch(new Navigate(['/auth/login']));
  }
github eranshmil / ngxs-example-app / src / app / auth / store / states / auth-status.state.ts View on Github external
logout({ dispatch, setState }: StateContext) {
    setState(authStatusStateDefaults);

    dispatch(new Navigate(['/login']));
  }
}
github abpframework / abp / npm / ng-packs / packages / account / src / lib / components / login / login.component.ts View on Github external
tap(() => {
          const redirectUrl = snq(() => window.history.state).redirectUrl || (this.options || {}).redirectUrl || '/';
          this.store.dispatch(new Navigate([redirectUrl]));
        }),
        catchError(err => {
github abpframework / abp / npm / ng-packs / packages / theme-basic / src / lib / components / application-layout / application-layout.component.ts View on Github external
logout() {
    this.oauthService.logOut();
    this.store.dispatch(
      new Navigate(['/'], null, {
        state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
      }),
    );
    this.store.dispatch(new GetAppConfiguration());
  }
}
github abpframework / abp / npm / ng-packs / dist / theme-basic / esm2015 / lib / components / application-layout / application-layout.component.js View on Github external
logout() {
        this.oauthService.logOut();
        this.store.dispatch(new Navigate(['/'], null, {
            state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
        }));
        this.store.dispatch(new GetAppConfiguration());
    }
}
github mflorence99 / el-aws / renderer / app / pages / root / tabs.ts View on Github external
onTabSelect(ix: number): void {
    const route = this.tabs[ix].route;
    this.store.dispatch(new Navigate([route]));
  }
github xmlking / ngx-starter-kit / libs / admin / src / lib / containers / notifications / notifications.component.ts View on Github external
_ => {
          this.snack.open(isNew ? 'Notification Created!' : 'Notification Updated!', 'OK', { duration: 5000 });
          this.store.dispatch(new Navigate(['/admin/notifications']));
        },
        error => this.snack.open(error, 'OK', { duration: 10000 }),
github mflorence99 / el-aws / renderer / app / pages / ddb / toolbar.ts View on Github external
loadTable(tableName: string): void {
    this.store.dispatch(new Navigate(['/ddb', tableName]));
  }

@ngxs/router-plugin

router plugin for @ngxs/store

MIT
Latest version published 17 days ago

Package Health Score

92 / 100
Full package analysis