Update page Title for SEO.
This commit is contained in:
21
frontend/src/app/services/seo.service.ts
Normal file
21
frontend/src/app/services/seo.service.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Title, Meta } from '@angular/platform-browser';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SeoService {
|
||||
defaultTitle = 'mempool - Bitcoin Explorer';
|
||||
|
||||
constructor(
|
||||
private titleService: Title,
|
||||
) { }
|
||||
|
||||
setTitle(newTitle: string) {
|
||||
this.titleService.setTitle(newTitle + ' - ' + this.defaultTitle);
|
||||
}
|
||||
|
||||
resetTitle() {
|
||||
this.titleService.setTitle(this.defaultTitle);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user