Compare commits

..

No commits in common. "96a81cb5ec8df87f7457532a036e926a10471b30" and "f24bda4cfeaec621a61aa4e63db6541a7f4b19da" have entirely different histories.

8 changed files with 12 additions and 69 deletions

View File

@ -1,20 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { Router, RouterEvent } from '@angular/router';
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit{
constructor(private router: Router){ }
ngOnInit(){
document.addEventListener('GoChangeRoute_Callback', (event:any) => {
this.router.navigate([event.detail])
console.log("here")
})
}
export class AppComponent {
title = 'go-web';
}

View File

@ -14,10 +14,9 @@ import { MainModule } from './components/main/main.module';
import { PlaygroundModule } from './components/playground/playground.module';
import { SandboxModule } from './components/sandbox/sandbox.module';
import { SignInModule } from './components/sign-in/sign-in.module';
import { LoadingScreenComponent } from './components/loading-screen/loading-screen.component';
@NgModule({
declarations: [AppComponent, LoadingScreenComponent],
declarations: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,

View File

@ -1 +0,0 @@
<p>loading-screen works!</p>

View File

@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoadingScreenComponent } from './loading-screen.component';
describe('LoadingScreenComponent', () => {
let component: LoadingScreenComponent;
let fixture: ComponentFixture<LoadingScreenComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoadingScreenComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(LoadingScreenComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,14 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
templateUrl: './loading-screen.component.html',
styleUrls: ['./loading-screen.component.scss']
})
export class LoadingScreenComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoadingScreenComponent } from '../components/loading-screen/loading-screen.component';
import { MainRoutingModule } from '../components/main/routing.module';
import { PlaygroundComponent } from '../components/playground/playground.component';
import { SandboxComponent } from '../components/sandbox/sandbox.component';
@ -12,7 +11,7 @@ const routes: Routes = [
component: PlaygroundComponent,
},
{
path: 'main',
path: '',
loadChildren: () => MainRoutingModule,
},
{
@ -23,10 +22,6 @@ const routes: Routes = [
path: 'sign-in',
component: SignInComponent,
},
{
path: '',
component: LoadingScreenComponent,
},
];
@NgModule({

View File

@ -9,16 +9,13 @@ export interface Go extends Window {
export interface GoCallback extends Window {
SetVersion: (value: string) => void;
GoChangeRoute: (value: string) => void;
}
let { GoGetGames, GoRunGame, GoGetSessions } = window as unknown as Go;
let { SetVersion, GoChangeRoute } = window as unknown as GoCallback;
let { SetVersion } = window as unknown as GoCallback;
let w = window as unknown as GoCallback;
// var register = function <Type>(name: string): void {
// const event = new CustomEvent<Type>(`${name}_Callback`, {
// detail: value
@ -28,11 +25,11 @@ let w = window as unknown as GoCallback;
// w.SetVersion = register<string>('SetVersion')
(<GoCallback>(<unknown>window)).GoChangeRoute = function <T>(value: T): void {
const event = new CustomEvent<T>('GoChangeRoute_Callback', {
detail: value,
});
document.dispatchEvent(event);
};
// (<GoCallback>(<unknown>window)).SetVersion = function <T>(value: T): void {
// const event = new CustomEvent<T>('GetVersion_Callback', {
// detail: value,
// });
// document.dispatchEvent(event);
// };
export { GoGetGames, GoGetSessions, SetVersion, GoRunGame, GoChangeRoute };
export { GoGetGames, GoGetSessions, SetVersion, GoRunGame };