chore(angular): update angular tests to ng v6 and latest stencil

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Adam Bradley
2018-05-16 11:40:28 -05:00
gitea-unlock(16/)
parent f3dc8a0fed
commit 3bb661fa11
octicon-diff(16/tw-mr-1) 182 changed files with 9755 additions and 5936 deletions

34
angular/src/providers/config.ts
View File

@@ -1,31 +1,51 @@
import { Config as CoreConfig } from '@ionic/core';
import { InjectionToken } from '@angular/core';
import { IonicWindow } from '../types/interfaces';
export class Config {
get(key: string, fallback?: any): any {
return getConfig().get(key, fallback);
const c = getConfig();
if (c) {
return c.get(key, fallback);
}
return null;
}
getBoolean(key: string, fallback?: boolean): boolean {
return getConfig().getBoolean(key, fallback);
const c = getConfig();
if (c) {
return c.getBoolean(key, fallback);
}
return null;
}
getNumber(key: string, fallback?: number): number {
return getConfig().getNumber(key, fallback);
const c = getConfig();
if (c) {
return c.getNumber(key, fallback);
}
return null;
}
set(key: string, value?: any) {
getConfig().set(key, value);
const c = getConfig();
if (c) {
c.set(key, value);
}
}
}
export const ConfigToken = new InjectionToken<any>('USERCONFIG');
function getConfig(): CoreConfig {
const Ionic = (window as any).Ionic;
if (Ionic && Ionic.config) {
return Ionic.config;
const win: IonicWindow = window as any;
if (typeof win !== 'undefined') {
const Ionic = win.Ionic;
if (Ionic && Ionic.config) {
return Ionic.config;
}
}
return null;
}

5
angular/src/providers/platform.ts
View File

@@ -1,7 +1,7 @@
import { EventEmitter, Injectable } from '@angular/core';
import { proxyEvent } from '../util/util';
import { PlatformConfig, detectPlatforms } from '@ionic/core';
import { proxyEvent } from '../util/util';
@Injectable()
export class Platform {
@@ -37,7 +37,6 @@ export class Platform {
resize = new EventEmitter<Event>();
constructor() {
proxyEvent(this.pause, document, 'pause');
proxyEvent(this.resume, document, 'resume');
proxyEvent(this.backButton, document, 'backbutton');