I am looking to integrate 3 TrustPilots into my Angular application.
import { Component, Input, OnInit } from '@angular/core';
declare global {
interface Window { Trustpilot: any; }
}
window.Trustpilot = window.Trustpilot || {};
@Component({
selector: 'app-trustbox-normal',
templateUrl: './trustbox-normal.component.html',
styleUrls: ['./trustbox-normal.component.scss']
})
export class TrustboxNormalComponent implements OnInit {
constructor() { }
ngOnInit(): void { }
ngAfterViewInit(){
const trustboxRef = document.getElementById('trustbox');
window.Trustpilot.loadFromElement(trustboxRef);
}
}
Everything is working smoothly on Brave and Firefox browsers, but when it comes to Safari, I encounter an issue:
window.Trustpilot.loadFromElement is not a function. (In 'window.Trustpilot.loadFromElement(trustboxRef)', 'window.Trustpilot.loadFromElement' is undefined)