From c0ec02e534746f3371d6e9abf579f362e0947a8d Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Fri, 27 Apr 2018 18:24:06 +0200 Subject: [PATCH] fix(angular): platform.ready() returns type --- angular/src/providers/platform.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/angular/src/providers/platform.ts b/angular/src/providers/platform.ts index df95b71288..27a04a7648 100644 --- a/angular/src/providers/platform.ts +++ b/angular/src/providers/platform.ts @@ -11,7 +11,7 @@ export interface PlatformConfig { export class Platform { private _platforms: PlatformConfig[] = []; - private _readyPromise: Promise; + private _readyPromise: Promise; /** * @hidden @@ -47,14 +47,14 @@ export class Platform { proxyEvent(this.backButton, document, 'backbutton'); proxyEvent(this.resize, document, 'resize'); - let readyResolve: Function; + let readyResolve: (value: string) => void; this._readyPromise = new Promise(res => { readyResolve = res; } ); if ((window as any)['cordova']) { window.addEventListener('deviceready', () => { - readyResolve(); - }); + readyResolve('cordova'); + }, {once: true}); } else { - readyResolve(); + readyResolve('dom'); } } @@ -150,7 +150,7 @@ export class Platform { } - ready(): Promise { + ready(): Promise { return this._readyPromise; }