
On narrow screens (where there is not enough room on the right to show the floating ToC), an embedded ToC is shown (via an `<aio-toc embedded>` element in the document). Since ToC was not a custom element, the component was not instantiated for the embedded element. This commit fixes it by making `aio-toc` a custom element and loading it manually for the floating ToC (if necessary). PR Close #23944
15 lines
514 B
TypeScript
15 lines
514 B
TypeScript
import { NgModule, Type } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { WithCustomElementComponent } from '../element-registry';
|
|
import { TocComponent } from './toc.component';
|
|
|
|
@NgModule({
|
|
imports: [ CommonModule, MatIconModule ],
|
|
declarations: [ TocComponent ],
|
|
entryComponents: [ TocComponent ],
|
|
})
|
|
export class TocModule implements WithCustomElementComponent {
|
|
customElementComponent: Type<any> = TocComponent;
|
|
}
|