Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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
Expand All @@ -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');
}
});
}
}
5 changes: 3 additions & 2 deletions client/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -30,7 +30,8 @@ import { LoggedInGuard } from './logged-in.guard';
AccountService,
ApiService,
ConfigService,
LoggedInGuard
LoggedInGuard,
Title
],
bootstrap: [ AppComponent ]
})
Expand Down
1 change: 0 additions & 1 deletion client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<base href="/">
<title>ISBX Angular2 Loopback Starter</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/config.js"></script>
Expand Down