mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
This reverts commit 2bd764a3c4.
PR Close #64584
This commit is contained in:
committed by
Jessica Janiuk
parent
99271bbeed
commit
9d48e534e2
@@ -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 {
|
||||
|
||||
@@ -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: '<ng-container routerOutlet [name]="name"/>',
|
||||
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(
|
||||
'<ng-component>popup component</ng-component><!--ng-container-->',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('component input binding', () => {
|
||||
|
||||
Reference in New Issue
Block a user