Bas Bas - 1 month ago 5
TypeScript Question

Angular 2 / typescript binding text to <meta property="og"> from component to index.html

How can I bind a variable of a component to the index.html
I want pass/bind a var from a component to the index.html specific i want to change the

<meta property="og:title" content="" />

Answer

You can try the following way:

let ogTitleMeta = document.querySelector('meta[property="og:title"]'); 
ogTitleMeta.content = 'change content here!';
Comments