ngx-meta title description data from database not showing in view source and facebook not able to crawl those tags

Viewed 153

I am using Angular 9 and Angular Universal(Server-side rendering)

When I try to set meta tags and description from database using service API call using ngx-meta package. Meta tag and description are coming in the inspect element but not coming in page view source. Due to which Facebook not able to crawl those dynamic meta tags.

Code I am using in component

    ngOnInit(): void {
    //api call to get title and desc from database
      this._service.getdata(url)
        .subscribe(
          (res) => {
            this.jobdes = res[0];
            this.titleService.setTitle(res[0].title);
            this.meta.addTag({ property: 'og:description', content: res[0].description});
            this.meta.addTag({ property: 'og:title', content: res[0].name});
          },
          err => {
           }
        )
    }
0 Answers
Related