George Kalpakas 6e05ae02a2 fix(aio): show embedded ToC (#23944)
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
2018-05-29 18:00:33 -04:00

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;
}