1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | const __chunk_1 = require('./stencilrouter-a3d77a87.js');
|
6 | const __chunk_2 = require('./chunk-94c92d88.js');
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | class RouteTitle {
|
15 | constructor(hostRef) {
|
16 | __chunk_1.registerInstance(this, hostRef);
|
17 | this.titleSuffix = '';
|
18 | this.pageTitle = '';
|
19 | }
|
20 | updateDocumentTitle() {
|
21 | const el = this.el;
|
22 | if (el.ownerDocument) {
|
23 | el.ownerDocument.title = `${this.pageTitle}${this.titleSuffix || ''}`;
|
24 | }
|
25 | }
|
26 | componentWillLoad() {
|
27 | this.updateDocumentTitle();
|
28 | }
|
29 | get el() { return __chunk_1.getElement(this); }
|
30 | static get watchers() { return {
|
31 | "pageTitle": ["updateDocumentTitle"]
|
32 | }; }
|
33 | }
|
34 | __chunk_2.ActiveRouter.injectProps(RouteTitle, [
|
35 | 'titleSuffix',
|
36 | ]);
|
37 |
|
38 | exports.stencil_route_title = RouteTitle;
|