Are there a progress with backporting Angular 2 Router into Angular 1?

189 Views Asked by At

As I understand ngComponentRouter (ngNewRouter) has been deprecated. And I didn't find any other alternatives but ngRoute & ui-router, which are obviously not designed to work with components.

1

There are 1 best solutions below

4
On

This is a pretty old question, but at that time as an alternative, the most popular was ngrx/router.

At the current point, Angular2 was released with its own router.

UPDATE

AngularJS ui-router component based approach:

export function routeConfig($stateProvider: ng.ui.IStateProvider): void {
$stateProvider
    .state('app.details', {
        url: '/app/details',
        template: '<app-details></app-details>'
    })
    .state('app.item', {
        url: '/app/item',
        template: '<app-item></app-item>'
    })
    .state('app.error', {
        url: '/app/error',
        template: '<error></error>'
    })
}