Angular

Integrate Jimo in your Angular app

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() {
        if (window.jimo != null) {
            return;
        }
        window.jimo = [];
        
        const script = this._renderer2.createElement('script');

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

Last updated