Reputation: 31
I got a problem in using AngularJS for dymamic meta tag. The data can't bind when js is still not work so both Google and Facebook can't reconigze true page title and description. Is there anyone can help me please.
Upvotes: 1
Views: 1555
Reputation: 6903
JS is not executed by OpenGraph crawler etc, so you need to do server side rendering to get this to work. A solution can be to check for the user agent to know if the page is being accessed by a real person or by a bot, and to render the page on the server side in the latter case.
The following article provides a good overview of how to do this quite easily.
http://www.michaelbromley.co.uk/blog/171/enable-rich-social-sharing-in-your-angularjs-app
Upvotes: 2