how to migrate internal states from angularjs to angular?

Found the solution myself. The following can be done:

create an angular js directive:

import * as angular from 'angular';

class RouterOutletWrapper {}


let routerOutletWrapper = {
    controller: RouterOutletWrapper,
    template: `<ui-view></ui-view>`
};

angular
.module('app')
.component('routerOutletWrapper', routerOutletWrapper);

and a matching Angular directive:

@Directive({
    selector: 'router-outlet-wrapper'
})
export class UpgradedAjsRouterOutletWrapper extends UpgradeComponent {
    constructor(elementRef: ElementRef, injector: Injector) {
        super('routerOutletWrapper', elementRef, injector);
    }
}

Then in then login component html write:

...
<router-outlet-wrapper></router-outlet-wrapper>
...

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top