Open ankitkante opened 7 years ago
Maybe checkout the 2.0-preview branch where it should be available as a pure-webcomponent (for any framework) and also Polymer 2.0. I've been waiting for Google to index a site to test it.
https://github.com/CaptainCodeman/app-metadata/tree/2.0-preview
Hi
I tried this branch. The problem I am facing is this:
Suppose when I route to a page and set the meta tags as follows (this.content
is received from the server):
let meta = document.querySelector('app-metadata');
meta.data = {
'title': this.content.name,
'description': this.content.short_description,
'og:title': this.content.name,
'og:description': this.content.short_description,
'og:image': this.content.cover_img_path,
};
Now, after this is done, I can see the meta tags in my html.
Now, there is a separate REST API that I call to get the content of the meta tag og:url
.
So, my question is: How do I set this value without disturbing the previously set meta tags. I tried the following code,but,it doesn't work:
meta.data['og:url']= this.shareUrl;
Make whatever code sets the metadata depend on both pieces.
Hi The syntax used to declare the
app-metadata
element is of Polymer 1.x. Do you plan to update the code to Polymer 2.0? If not, what is your opinion on the compatibility of this element with Polymer 2.x