17

I am upgrading my application progressively using the Upgrade Adapter. My app uses ui-router (+ has child routes).

I read this great article about routing in Angular 2. My question is:

Is it possible to use new router while still in Angular 1.X app + Upgrade adapter?

For example:

I have an angular 1.X template with <div ui-view=""></div>. When I upgrade it to be Angular 2.0 component I must use the new component router with it, because Angular 2.0 is rendering this component now. But, in order to use it I should do:

bootstrap(App, [provide(LocationStrategy, { useClass: PathLocationStrategy })])

Which I do not have when bootstraping with the Upgrade Adater!

Should I first move the bootstrap to be Angular 2 and only then move to the Component router?

Thanks

Mistalis
  • 17,793
  • 13
  • 73
  • 97
Yaniv Efraim
  • 6,633
  • 7
  • 53
  • 96

1 Answers1

0

Absolutely! Your component containing ui-view should be changed to a router-outlet, but otherwise, you should be able to convert your routes to AngularJS components and use them with the new RouterModule.

wilsonhobbs
  • 941
  • 8
  • 18