dynamically update og meta tags in angular
Asked Answered
S

1

6

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.

Surculose answered 2/3, 2022 at 9:43 Comment(1)
You can use the sharing debugger to find out the problemNickienicklaus
V
1

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.

Vitrescent answered 26/3, 2022 at 16:27 Comment(3)
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/universalShorten

© 2022 - 2024 — McMap. All rights reserved.