NgDocShortcutsService
Keyboard shortcuts of the documentation.
Single-key shortcuts (slash opens the search, the square brackets open the previous and next page, F focuses the filter of the page, L copies the link to the page and T switches between the light and the dark theme) are on by default. Readers turn them all off with one switch, and the choice is saved in the browser. A site turns them off by default with the shortcuts option of provideNgDocApp. They never run while the reader types in a field or holds Command, Control or Alt. Chords such as Command+K (Control+K) always work.
- Decorators
@Service
@Service ()
export class NgDocShortcutsService { … }Members
Constructor1 | |||||||
() | — | ||||||
Signature | |||||||
Properties1 | |||||||
enabled: | Whether single-key shortcuts are on: the reader's saved choice, or the site's default. Components hide the hints of single-key shortcuts while it is false. | ||||||
Methods4 | |||||||
(…): () => void | Registers a shortcut. When several shortcuts use the same key, the one registered last runs, so a page can take over a key while it is shown and give it back when it is destroyed. | ||||||
Signature Parameters
Returns () => void -A function that removes the shortcut. | |||||||
(…): boolean | Runs the single-key shortcut registered for a key, as if the reader pressed it, even while single-key shortcuts are off. The search palette uses it for its actions. | ||||||
Signature Parameters
Returns boolean -Whether a shortcut is registered for the key. | |||||||
(…): void | Turns single-key shortcuts on or off for this reader and saves the choice in the browser. | ||||||
Signature Parameters
Returns void | |||||||
(): void | Turns single-key shortcuts off when they are on, and on when they are off. | ||||||
Signature Returns void | |||||||