Browse Source

js设置title

seimin 2 years ago
parent
commit
1257fb178d
2 changed files with 7 additions and 2 deletions
  1. 6 1
      src/app/app.component.ts
  2. 1 1
      src/index.html

+ 6 - 1
src/app/app.component.ts

@@ -1,7 +1,12 @@
1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
+import { Title } from '@angular/platform-browser';
2
 @Component({
3
 @Component({
3
   selector: 'app-root',
4
   selector: 'app-root',
4
   templateUrl: './app.component.html',
5
   templateUrl: './app.component.html',
5
   styleUrls: ['./app.component.less']
6
   styleUrls: ['./app.component.less']
6
 })
7
 })
7
-export class AppComponent {}
8
+export class AppComponent {
9
+  constructor(private titleService:Title){
10
+    this.titleService.setTitle('大势医院输送保障管理平台')
11
+  }
12
+}

+ 1 - 1
src/index.html

@@ -3,7 +3,7 @@
3
 
3
 
4
 <head>
4
 <head>
5
   <meta charset="utf-8">
5
   <meta charset="utf-8">
6
-  <title>大势医院输送保障管理平台</title>
6
+  <title></title>
7
   <base href="/">
7
   <base href="/">
8
   <meta http-equiv="Expires" content="0">
8
   <meta http-equiv="Expires" content="0">
9
   <meta http-equiv="Pragma" content="no-cache">
9
   <meta http-equiv="Pragma" content="no-cache">