Get started | Install our snippet
Give Feedback

Angular

Updated on December 22, 2022

Here is a way to load the snippet with Angular

import { Renderer2, OnInit, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';

class MyComponent implements OnInit {

    constructor(
        private _renderer2: Renderer2, 
        @Inject(DOCUMENT) private _document: Document
    ) { }

    public ngOnInit() {

        const script = this._renderer2.createElement('script');

        window.jimo = [];
        window['JIMO_PROJECT_ID'] = "ID_OF_YOUR_PROJECT"; // Update this
        script.type = `application/ld+json`;
        s.type = 'text/javascript';
        s.async = true;
        s.src = "https://undercity.usejimo.com/jimo-invader.js";
        this._renderer2.appendChild(this._document.body, script);
    }
}