java-go experiments

This commit is contained in:
wagonsoftware 2022-10-17 16:54:44 +03:00
parent 07e7c8845d
commit 188f7b6aa2
4 changed files with 31 additions and 11 deletions

View File

@ -1,3 +1 @@
Test (version: {{version}})
<button (click)="getVersion()">Get version</button>
<app-games-bar></app-games-bar>

View File

@ -0,0 +1,7 @@
a {
padding: 10px;
&.active {
background: green;
}
}

View File

@ -1,5 +1,4 @@
import { Component } from '@angular/core';
import { GetVersion, GetVersionCallbackDetail } from './services/go';
@Component({
selector: 'app-root',
@ -10,13 +9,28 @@ export class AppComponent {
title = 'go-web';
version: string | null = null;
games: { id: string; name: string }[] = [
{
id: 'game-1',
name: 'Game one',
},
{
id: 'game-2',
name: 'Game two',
},
{
id: 'game-3',
name: 'Game three',
},
];
constructor() {}
getVersion() {
document.addEventListener('GetVersion_Callback', (event: Event): void => {
if (!(event instanceof CustomEvent<string>)) return;
this.version = event.detail;
});
GetVersion();
// document.addEventListener('GetVersion_Callback', (event: Event): void => {
// if (!(event instanceof CustomEvent<string>)) return;
// this.version = event.detail;
// });
// GetVersion();
}
}

View File

@ -6,12 +6,13 @@ import {
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppRoutingModule } from './modules/app-routing.module';
import { AppComponent } from './app.component';
import { GamesBarModule } from './components/games-bar/games-bar.module';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AppRoutingModule],
imports: [BrowserModule, AppRoutingModule, GamesBarModule],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
{ provide: LocationStrategy, useClass: HashLocationStrategy },