I cannot extend RouterOutlet when using a new router in RC.
Example:
import { Directive } from '@angular/core'; import { Router, ROUTER_DIRECTIVES, RouterOutlet } from '@angular/router'; @Directive({ selector: 'router-outlet' }) export class RouterOutletDirective extends RouterOutlet { }
Error:
@ angular / router / index "'does not have an exported element' RouterOutlet '.
Am I doing something wrong or has it broken with the new router in RC.1?
Updated:
import { Directive, Attribute, ViewContainerRef, DynamicComponentLoader } from '@angular/core'; import { Router, Routes, RouterOutletMap } from '@angular/router'; import { RouterOutlet } from '@angular/router/src/directives/router_outlet'; @Directive({ selector: 'router-outlet' }) export class RouterOutletDirective extends RouterOutlet { constructor(parentOutletMap: RouterOutletMap, _location: ViewContainerRef, name: string) { super(parentOutletMap, _location, name); console.log( parentOutletMap ); } activate() { console.log('Activate'); } }
So now it works, but the RouterOutlet is underlined in red, and the type "any" is not the type of the constructor function, and the activating part does not work. Did I miss something?
source share