23 lines
556 B
TypeScript
23 lines
556 B
TypeScript
|
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<string>)) return;
|
||
|
this.version = event.detail;
|
||
|
});
|
||
|
GetVersion();
|
||
|
}
|
||
|
}
|