import { DOCUMENT } from '@angular/common' ; import { Directive , Input , OnInit , Renderer2 , Inject } from '@angular/core' ; @ Directive ( { selector : '[drpJsonLd]' , } ) export class JsonLdEventDirective implements OnInit { @ Input ( ) drpJsonLd ? = 'Dark' ; constructor ( @ Inject ( DOCUMENT ) private document , private renderer ) { } ngOnInit ( ) { const jsonPlScript = this . renderer . createElement ( 'script' ) ; jsonPlScript . type = 'application/ld+json' ; jsonPlScript . text = `
    
    
    ` ; this . renderer . appendChild ( this . document . head , jsonPlScript ) ; } }