Skip to content

Instantly share code, notes, and snippets.

@zzpzaf
Created December 4, 2024 09:11
Show Gist options
  • Save zzpzaf/7595c5e7fae6e1d18b12d044fa202111 to your computer and use it in GitHub Desktop.
Save zzpzaf/7595c5e7fae6e1d18b12d044fa202111 to your computer and use it in GitHub Desktop.
ang18-SSR-SEO-SupportBlog2-SeoService-renderer-createElement-example1
. . .
const script = this.renderer.createElement('script');
this.renderer.setAttribute(script, 'type', 'application/ld+json');
this.renderer.appendChild(script, this.renderer.createText(JSON.stringify(structuredData)));
this.renderer.appendChild(this.renderer.selectRootElement('head', true), script);
}
. . .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment