1

I cannot figure out how can I navigate to another page/component with hybrid Angular.

In Angular 2 we use Router and something like:

this.router.navigate(['/items']);

In hybrid Angular I use hybrid routing with:

import { UIRouterUpgradeModule, NgHybridStateDeclaration } from '@uirouter/angular-hybrid';

How can I navigate from within typescript to another page/component with hybrid Angular?

lucas
  • 4,445
  • 6
  • 28
  • 48

2 Answers2

0

You are actually using the uirouter. It is the hybrid version but still it is the uirouter. For the equivalent of this.router.navigate you can use:

this.uirouter.stateService.go('items');
Koen Meijer
  • 811
  • 11
  • 19
0

Look at this repository github.com/Zadvornyi/angular-hybrid-webpack, where implement @uirouter/angular-hybrid router. After implementing you can use standard method:

  • Angular JS $state.go('some state')
  • Angular 2+ this.$stage.go('some stage')