From c43e7caeeac530ba816d4a53efb6611a38eefda9 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 8 Feb 2024 17:48:01 +0200 Subject: [PATCH] [angular-16-irish-monitor | ADDED]: Add url in base component --- sharedComponents/base/base.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sharedComponents/base/base.component.ts b/sharedComponents/base/base.component.ts index 34fe7bc1..922db351 100644 --- a/sharedComponents/base/base.component.ts +++ b/sharedComponents/base/base.component.ts @@ -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'");