Skip to content

Commit

Permalink
fix(angular): platform ready()
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 20, 2018
1 parent 4ea8881 commit 2b3c14b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
17 changes: 13 additions & 4 deletions angular/src/providers/platform.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@

import { PlatformConfig } from '@ionic/core';
import { HostListener } from '@angular/core';

export class Platform {

private _platforms: PlatformConfig[];
private _platforms: PlatformConfig[] = [];
private _readyPromise: Promise<any>;
private _readyResolve: any;

constructor() {
this._readyPromise = new Promise(res => { this._readyResolve = res; } );
let readyResolve: Function;
this._readyPromise = new Promise(res => { readyResolve = res; } );
if ((window as any)['cordova']) {
window.addEventListener('deviceready', () => {
readyResolve();
});
} else {
readyResolve();
}
}

/**
* @returns {boolean} returns true/false based on platform.
* @description
Expand Down Expand Up @@ -102,7 +111,7 @@ export class Platform {
}


ready(): Promise<string> {
ready(): Promise<void> {
return this._readyPromise;
}

Expand Down
3 changes: 2 additions & 1 deletion core/src/components/action-sheet/action-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import mdLeaveAnimation from './animations/md.leave';
})
export class ActionSheet implements OverlayInterface {

presented = false;
mode!: Mode;
color!: string;

presented = false;
animation?: Animation;

@Element() el!: HTMLElement;
Expand Down
5 changes: 0 additions & 5 deletions core/src/components/router/test/parser.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ describe('parser', () => {
win = new TestWindow();
});
});
export class TestWindow2 {

}
export declare interface TestWindow2 extends Window {}


export function mockRouteElement(win: Window, path: string, component: string) {
const el = win.document.createElement('ion-route');
Expand Down

0 comments on commit 2b3c14b

Please sign in to comment.