{ "id": "api/platform-browser/Title", "title": "Title", "contents": "\n\n
\n
\n
\n \n API > @angular/platform-browser\n
\n \n
\n \n
\n

Titlelink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

A service that can be used to get and set the title of a current HTML document.

\n\n

See more...

\n
\n \n \n \n
\n\nclass Title {\n getTitle(): string\n setTitle(newTitle: string)\n}\n\n\n \n \n\n
\n\n\n \n\n \n \n
\n

Descriptionlink

\n

Since an Angular application can't be bootstrapped on the entire HTML document (<html> tag)\nit is not possible to bind to the text property of the HTMLTitleElement elements\n(representing the <title> tag). Instead, this service can be used to set and get the current\ntitle value.

\n\n \n
\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n
\n

Methodslink

\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n getTitle()\n \n link

\n \n
\n
\n

Get the title of the current HTML document.

\n\n
\n
\n \n\n getTitle(): string\n\n \n\n
Parameters
\n

There are no parameters.

\n\n \n
Returns
\n

string

\n\n \n\n\n \n\n \n
\n
\n\n \n \n\n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n
\n
\n

\n setTitle()\n \n link

\n \n
\n
\n

Set the title of the current HTML document.

\n\n
\n
\n \n\n setTitle(newTitle: string)\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n
\n \n newTitle\n string\n \n \n
\n\n \n\n\n \n\n \n
\n
\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }