import { Component } from '@angular/core'; import { GetVersion, GetVersionCallbackDetail } from './services/go'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) export class AppComponent { title = 'go-web'; version: string | null = null; constructor() {} getVersion() { document.addEventListener('GetVersion_Callback', (event: Event): void => { if (!(event instanceof CustomEvent)) return; this.version = event.detail; }); GetVersion(); } }