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

4
  • I don't know about UpgradeAdapter, but the code line you posted seems quite outdated. It's <= 2.0.0-RC.5. Now we are at 2.4.6. Commented Apr 7, 2017 at 8:57
  • Yep, this question is almost one and a half years old... Commented Apr 7, 2017 at 9:02
  • Sorry, the question popped up in the stream because of the edit. I didn't check the date. Commented Apr 7, 2017 at 9:03
  • Possible duplicate of angular ui-router login authentication Commented Aug 23, 2017 at 1:35

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.