1 import {Component, Input, AfterViewInit, ViewChild} from '@angular/core';
2 import {Title} from '@angular/platform-browser';
3 import {StringComponent} from '@eg/share/string/string.component';
6 <eg-title i18n-prefix i18n-suffix
7 prefix="Patron #{{patronId}}
11 Tab title shows (in en-US): "Patron #123 - Staff Client"
16 templateUrl: 'title.component.html'
19 export class TitleComponent implements AfterViewInit {
24 @Input() set prefix(p: string) {
30 @Input() set suffix(s: string) {
35 @ViewChild('titleString') titleString: StringComponent;
37 constructor(private title: Title) {}
46 // Avoid setting the title while the page is still loading
47 if (!this.initDone) { return; }
50 this.titleString.current({pfx: this.pfx, sfx: this.sfx})
51 .then(txt => this.title.setTitle(txt));