Поделиться ссылкой на Facebook

# #html #angular #typescript #firebase #meta-tags

Вопрос:

Я пытался добавить информацию, которая должна появиться во время публикации веб-страницы в Facebook, в виде миниатюры и заголовка сообщения в блоге. Я развернул его на огневой базе и проверял. На нем не отображается соответствующее изображение и название блога.

Я использую og в мета-теге. Я пробовал использовать статические данные в index.html он работает, но в других компонентах он не работает с динамическими данными.

Я использую angular с firebase.

 this.blogdetailService.getSpecificBlogDetails(this.$key).subscribe(
  Blog => {
    this.blog = Blog[0];
    this.titleService.setTitle(this.blog.meta_title);
    this.meta.updateTag({name: 'title', content: this.blog.meta_title});
    this.meta.updateTag({name: 'keywords', content: this.blog.meta_keywords});
    this.meta.updateTag({name: 'description', content: this.blog.meta_description});
    this.meta.updateTag({ name: 'og:image', content: this.blog.blogImage });
    this.meta.updateTag({ name: 'og:title', content: this.blog.title });
    this.meta.updateTag({ name: 'og:type', content: "webiste" });
    // this.meta.updateTag({ name: 'og:locale', content: "en_us" });
    // this.meta.updateTag({ name: 'og:image:width', content: "400" });
    // this.meta.updateTag({ name: 'og:image:height', content: "300" });
    this.meta.updateTag({ name: 'og:url', content: window.location.href });
    this.meta.updateTag({ name: 'og:site_name', content: this.blog.title });
  }
);