dynamically added meta tags does not recognize facebook
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
Current behavior
Expected/desired behavior
Minimal reproduction of the problem with instructions
import { MetaService } from '@ngx-meta/core';
import { FirstService } from './first.service';
export class FirstComponent {
firstObj : any = {};
constructor(private _metaService: MetaService,
private _firstService: FirstService) {}
ngOnInit() {
this._firstService.getQuestionOfTheWeek(0).subscribe(
res => firstObj = res,
error => this.errorGetRequest(error),
() => this.successGetRequest()
);
}
successGetRequest(){
this._metaService.setTag('og:description', this.firstObj .Desc);
this._metaService.setTag('og:image', this.firstObj .ImageURL);
}
}
What is the motivation / use case for changing the behavior?
Meta tag are getting added it is visible in the chrome developer tool but facebook does not recognize.
Environment
- Angular version: 4.0.0
- Browser:
- Chrome (desktop) version XX
- Chrome (Android) version XX
- Chrome (iOS) version XX
- Firefox version XX
- Safari (desktop) version XX
- Safari (iOS) version XX
- IE version XX
- Edge version XX
- For Tooling issues:
- Node version: XX <!-- run
node --version
--> - Platform:
- Others:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:53
Top Results From Across the Web
Angular 6 : Dynamic Meta tag is not working when sharing ...
When I check by inspect, it will show updated data but when I share the link on Facebook it will not reflect updated...
Read more >Meta-Tag domain verification failed - Developer Community ...
Hi community! I try to verify my domain in Business Manager. My provider (Jimdo) offers only one supported method: I can only add...
Read more >Dynamically add Facebook OpenGraph meta tags to page ...
How to dynamically add Facebook OpenGraph tags to the page's head based on the current page's title and description in Sitefinity.
Read more >Adding Meta Tags using JavaScript
You may find yourself in a situation where you need to add a custom meta tag or Canonical URL to your <head> template,...
Read more >Dynamically change Facebook open graph meta data ... - drib
In most situation Facebook open graph (og) meta tags will be filled while a page is being generated – before it is served...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ishan123456789 @thecoconutstudio Somehow the emails got filtered out and I never observed these comments from both of you.
The below code is of course the most horrible hack, but it worked for me when no other solution on net was working. Till Angular team provides a fix, we decided to go with this.
Here’s my partial code.
And in index.html, create template values as below:
@gianpaj I used server side rendering page but still not working. When I am doing view source on browser developer tool than meta tags are available. facebook Sharing Debugger doesn’t shows OG tags.