I want to share some dynamic content to WhatsApp, the dynamic content gets from an API. therefore I used the angular Meta class in my component.ts file to update the default meta tag property in index.html with the dynamic content.
dynamically update og meta tags in angular
Asked Answered
You can use the sharing debugger to find out the problem –
Nickienicklaus
You could try the meta tags validator here: https://thumbsmith.com/validator/
Also make sure that the dynamic (per page) content is available server-side, and not just client-side.
A quick trick to easily check the server-side HTML is to can prepend view-source:
to the URL in chrome or right-click > view page source.
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. –
Acclimate
@Alexandre Lotte, how would I make the content available server-side? Usually angular apps are populated with data client side, or am I wrong here? –
Expand
You need Angular SSR (Universal) : angular.io/guide/universal –
Shorten
© 2022 - 2024 — McMap. All rights reserved.