Q:

How to get meta tags work correctly in angular 2?

I am creating a news website using angular 2. Every thing work fine except when it comes to meta tags. I used ng2-meta and it is adding the tags to the heading, but when I put the url on facebook or twitter it does not show the image or the title.
   - any suggestion pleased?
thanks in advance.  

A:

You should go with server side rendering with ng2-meta the tags are set but when you put the url to any social network the crawler won't execute angular or probably not wait for angular to set meta tags here are useful links you can start from.
demo: https://scotchiversal.herokuapp.com/
https://universal.angular.io/
https://scotch.io/tutorials/server-side-rendering-in-angular-2-with-angular-universal
after this you angular2 app is rendered from server so social sites can read meta tags etc.

