Title
可以用来获取和设置当前 HTML 文档标题的服务。
A service that can be used to get and set the title of a current HTML document.
class Title {
getTitle(): string
setTitle(newTitle: string)
}
Provided in
'root'
说明
由于 Angular 应用程序不能在整个 HTML 文档(<html>
标签)上引导,因此无法绑定到 HTMLTitleElement
的 text
属性(即 <title>
标签)。可以改用此服务来设置和获取当前标题值。
Since an Angular application can't be bootstrapped on the entire HTML document (<html>
tag) it is not possible to bind to the text
property of the HTMLTitleElement
elements (representing the <title>
tag). Instead, this service can be used to set and get the current title value.
方法
获取当前 HTML 文档的标题。 Get the title of the current HTML document. |
参数没有参数。 返回值
|
设置当前 HTML 文档的标题。 Set the title of the current HTML document. |