diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 395fc07..8aa3451 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,6 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, AfterViewInit } from '@angular/core'; import { Router, RouterEvent } from '@angular/router'; +import { GoWebViewInit } from './services/go'; @Component({ selector: 'app-root', @@ -16,5 +17,8 @@ export class AppComponent implements OnInit{ console.log("here") }) } + ngAfterViewInit(){ + GoWebViewInit() + } title = 'go-web'; } diff --git a/src/app/services/go.ts b/src/app/services/go.ts index 84fc019..47482b1 100644 --- a/src/app/services/go.ts +++ b/src/app/services/go.ts @@ -5,6 +5,7 @@ export interface Go extends Window { GoGetGames: () => Promise; GoGetSessions: () => Promise GoRunGame: (gameId: string) => void; + GoWebViewInit: () => void; } export interface GoCallback extends Window { @@ -12,7 +13,7 @@ export interface GoCallback extends Window { GoChangeRoute: (value: string) => void; } -let { GoGetGames, GoRunGame, GoGetSessions } = window as unknown as Go; +let { GoGetGames, GoRunGame, GoGetSessions, GoWebViewInit } = window as unknown as Go; let { SetVersion, GoChangeRoute } = window as unknown as GoCallback; let w = window as unknown as GoCallback; @@ -35,4 +36,4 @@ let w = window as unknown as GoCallback; document.dispatchEvent(event); }; -export { GoGetGames, GoGetSessions, SetVersion, GoRunGame, GoChangeRoute }; +export { GoGetGames, GoGetSessions, SetVersion, GoRunGame, GoChangeRoute, GoWebViewInit };