java-go experiments
This commit is contained in:
parent
07e7c8845d
commit
188f7b6aa2
@ -1,3 +1 @@
|
||||
Test (version: {{version}})
|
||||
|
||||
<button (click)="getVersion()">Get version</button>
|
||||
<app-games-bar></app-games-bar>
|
||||
|
@ -0,0 +1,7 @@
|
||||
a {
|
||||
padding: 10px;
|
||||
|
||||
&.active {
|
||||
background: green;
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user