Skip to content
@ng-doc/app / Class

NgDocTocComponent

The "On this page" rail: the headings of the page, the section the reader is in, the reading progress, and the Back to top, Copy link and Edit this page actions.

The active section follows scrolling: it is the last heading above a line a little below the navbar, or the last heading once the page is scrolled to the end. A heading the reader picked (an entry clicked, or a link to its fragment) stays active until the reader scrolls again, so a section near the end of the page, which cannot scroll to the top, is still marked. A soft marker glides to the active entry. Tracking pauses while the rail is hidden.

While the rail exists, the L shortcut runs its Copy link action, so the rail confirms the copy.

Decorators
@Component
Selectors
ng-doc-toc
Implements
NgDocPageToc
DeclarationTypeScript
@Component({ … })
export class NgDocTocComponent implements NgDocPageToc { … }

Members

Constructor

1
()
—

Properties

8
activeIndex: WritableSignal<number>
protectedreadonly

Index of the heading of the section the reader is in.

activeItem: Signal<NgDocTocItem | undefined>
readonly

The heading of the section the reader is in.

copied: WritableSignal<boolean>
protectedreadonly

Whether the link was just copied.

details: InputSignal<Element | undefined>
readonly input() implements NgDocPageToc

The symbol details of an API page, shown above the headings.

document: Document
protectedreadonly
—
editSourceFileUrl: InputSignal<string | undefined>
readonly input() implements NgDocPageToc

URL where the reader can edit the page source. Without it, the rail has no Edit action.

progress: WritableSignal<number>
protectedreadonly

How much of the page has been scrolled, in percent.

tableOfContent: InputSignal<NgDocTocItem[]>
readonly input() implements NgDocPageToc

The headings of the page.

Methods

3
(…): void

Marks a heading as the active section until the reader scrolls again.

(): void

Scrolls the page back to its top.

Symbol
Kind
Class
Decorators
@Component
Selectors
ng-doc-toc
Implements
NgDocPageToc
Scope
@ng-doc/app
Edit this page