Skip to content

Commit

Permalink
fixed dynamic canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
imayushsaini committed Jul 15, 2023
1 parent 71c5b04 commit a024e31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/app/pages/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class HomepageComponent implements OnInit,OnDestroy {
this._seoService.updateOgUrl(data.ogUrl);
//Updating Description tag dynamically with title
this._seoService.updateDescription(data.description)
this._seoService.updateCanonicalTag("https://bombsquad-community.web.app/home")
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/app/services/seoservice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export class SEOServiceService {
}

updateOgUrl(url: string) {
this.meta.addTag({ name: 'og:url', content: url })
this.meta.updateTag({ name: 'og:url', content: url })
this.meta.removeTag('rel="canonical"');
this.meta.addTag({ rel: 'canonical', href: url });
}

updateDescription(desc: string) {
this.meta.updateTag({ name: 'description', content: desc })
this.meta.updateTag({ name: 'og:description', content: desc })
}
updateCanonicalTag(url:string ) {
this.meta.addTag({ rel: 'canonical', href: url });
}

}

0 comments on commit a024e31

Please sign in to comment.