Skip to content

Commit fc8f468

Browse files
pkozlowski-opensourcetbosch
authored andcommitted
docs(Title): add documentation for the Title service
Closes angular#3063
1 parent 3f6dd6c commit fc8f468

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
import {DOM} from 'angular2/src/dom/dom_adapter';
22

3+
/**
4+
* A service that can be used to get and set the title of a current HTML document.
5+
*
6+
* Since an Angular 2 application can't be bootstrapped on the entire HTML document (`<html>` tag)
7+
* it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
8+
* (representing the `<title>` tag). Instead, this service can be used to set and get the current
9+
* title value.
10+
*/
311
export class Title {
12+
/**
13+
* Get the title of the current HTML document.
14+
* @returns {string}
15+
*/
416
getTitle(): string { return DOM.getTitle(); }
517

18+
/**
19+
* Set the title of the current HTML document.
20+
* @param newTitle
21+
*/
622
setTitle(newTitle: string) { DOM.setTitle(newTitle); }
723
}

0 commit comments

Comments
 (0)