[angular-16-irish-monitor | ADDED]: Add url in base component

This commit is contained in:
Konstantinos Triantafyllou 2024-02-08 17:48:01 +02:00
parent 75ecd0da5e
commit c43e7caeea
1 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ export abstract class BaseComponent implements OnDestroy {
/** Metadata */
public title: string;
public description: string;
public url: string;
protected _route: ActivatedRoute;
protected _piwikService: PiwikService;
protected _meta: Meta;
@ -85,12 +86,12 @@ export abstract class BaseComponent implements OnDestroy {
this._title.setTitle(this.title);
}
if (this._router) {
const url = properties.domain + properties.baseLink + this._router.url;
this.url = properties.domain + properties.baseLink + this._router.url;
if (this.seoService) {
this.seoService.createLinkForCanonicalURL(url, false);
this.seoService.createLinkForCanonicalURL(this.url, false);
}
if (this._meta) {
this._meta.updateTag({content: url}, "property='og:url'");
this._meta.updateTag({content: this.url}, "property='og:url'");
this._meta.updateTag({content: this.description}, "name='description'");
this._meta.updateTag({content: this.description}, "property='og:description'");
this._meta.updateTag({content: this.title}, "property='og:title'");