Angular 2 - Is it possible to use the new router while upgrading with the "Upgrade Adapter"

Discussão em 'Angular' iniciado por Yaniv Efraim, Março 7, 2025.

  1. Yaniv Efraim

    Yaniv Efraim Guest

    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

    Continue reading...

Compartilhe esta Página