diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 17a6722..0994115 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { Title } from '@angular/platform-browser'; +import { NavigationEnd, Router } from '@angular/router'; import { AccountService } from './services/account.service'; @@ -12,7 +14,7 @@ import '../styles.styl'; export class AppComponent implements OnInit { - constructor(private accountService: AccountService) { } + constructor(private accountService: AccountService, public router: Router, private titleService: Title) { } public ngOnInit(): void { // used during initial load to populate the currentUser if we have an accessToken stored @@ -25,5 +27,10 @@ export class AppComponent implements OnInit { // do nothing } ); + this.router.events.subscribe((e) => { + if (e instanceof NavigationEnd) { + this.titleService.setTitle('ISBX Angular2 Loopback Starter'); + } + }); } } diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 7e092d5..d644d5c 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; -import { BrowserModule } from '@angular/platform-browser'; +import { BrowserModule, Title } from '@angular/platform-browser'; import { RouterModule } from '@angular/router'; import { AppComponent } from './app.component'; @@ -30,7 +30,8 @@ import { LoggedInGuard } from './logged-in.guard'; AccountService, ApiService, ConfigService, - LoggedInGuard + LoggedInGuard, + Title ], bootstrap: [ AppComponent ] }) diff --git a/client/src/index.html b/client/src/index.html index 201d2ff..5111f8f 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -2,7 +2,6 @@