Skip to content
@ng-doc/app / Function

provideNgDocTitle

Builds the browser tab title of every navigation with a function that receives the categories, the page, the tab and the API declaration of the route, so titles like "Installation · Getting started | NgDoc" need no parsing of route titles.

Without it, Angular sets the title of the deepest route: the page's (or its tab's) title.

DeclarationTypeScript

Returns

Parameters

NameTypeDescription
titleFn
NgDocTitleFn

Builds the title; undefined keeps the current title.

Example usage

provideNgDocTitle(({ categories, page, tab, api, title }) => {
  const name = api ?? page;

  return name
    ? [tab, name, ...[...categories].reverse()].filter(Boolean).join(' · ') + ' | My library'
    : (title ?? 'My library');
});
Symbol
Kind
Function
Scope
@ng-doc/app
Edit this page