diff --git a/goldens/public-api/router/index.api.md b/goldens/public-api/router/index.api.md index 19e43db9e47..f0793957bc2 100644 --- a/goldens/public-api/router/index.api.md +++ b/goldens/public-api/router/index.api.md @@ -901,7 +901,7 @@ export class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract { readonly routerOutletData: i0.InputSignal; readonly supportsBindingToComponentInputs = true; // (undocumented) - static ɵdir: i0.ɵɵDirectiveDeclaration; + static ɵdir: i0.ɵɵDirectiveDeclaration; // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; } diff --git a/packages/router/src/directives/router_outlet.ts b/packages/router/src/directives/router_outlet.ts index 02a69df0766..516c0752533 100644 --- a/packages/router/src/directives/router_outlet.ts +++ b/packages/router/src/directives/router_outlet.ts @@ -204,7 +204,7 @@ export interface RouterOutletContract { * @publicApi */ @Directive({ - selector: 'router-outlet, ng-container[routerOutlet]', + selector: 'router-outlet', exportAs: 'outlet', }) export class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract { diff --git a/packages/router/test/directives/router_outlet.spec.ts b/packages/router/test/directives/router_outlet.spec.ts index 5f8f690cd92..a5b197fb570 100644 --- a/packages/router/test/directives/router_outlet.spec.ts +++ b/packages/router/test/directives/router_outlet.spec.ts @@ -194,31 +194,6 @@ describe('router outlet name', () => { // Not contain because route was changed back to parent expect(fixture.nativeElement.innerHTML).not.toContain('child component'); }); - - it('should be able to use a router outlet on an ng-container', async () => { - @Component({ - template: '', - imports: [RouterOutlet], - }) - class RootCmp { - name = 'popup'; - } - - @Component({ - template: 'popup component', - }) - class PopupCmp {} - - TestBed.configureTestingModule({ - imports: [RouterModule.forRoot([{path: '', outlet: 'popup', component: PopupCmp}])], - }); - const router = TestBed.inject(Router); - const fixture = await createRoot(router, RootCmp); - - expect(fixture.nativeElement.innerHTML.trim()).toBe( - 'popup component', - ); - }); }); describe('component input binding', () => {