octicon-rss(16/)
You've already forked ionic-framework
mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 22:44:13 +08:00
chore(angular): update angular tests to ng v6 and latest stencil
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
octicon-diff(16/tw-mr-1) 182 changed files with 9755 additions and 5936 deletions
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user