I've requirement to update meta tags like og:title,og:description and og:image dynamically and share the same on facebook, I've tried everything but nothing works.
So first of all I've tried to set meta tag with javascript like below:
var meta = document.createElement('meta');
meta.httpEquiv = "X-UA-Compatible";
meta.content = "IE=edge";
document.getElementsByTagName('head')[0].appendChild(meta);
then I've tried to use angular meta tag like below:
To add:-
this.meta.addTag({ name: 'og:description', content: 'How to use Angular 6 meta service' });
To update:-
this.meta.updateTag({ name: 'og:description', content: 'Angular 6 meta service' });
but that all fails and finally I've tried below meta package,
https://github.com/vinaygopinath/ng2-meta
but still I'm having issue with dynamic fields while sharing my site url to facebook, it should show dynamic contents if someone post url on post.
if anyone have idea please let me know!