style(lint): fix lint errors

This commit is contained in:
Adam Bradley
2018-03-01 16:21:06 -06:00
parent e84ddb69dc
commit 9c93df48d8
36 changed files with 313 additions and 115 deletions

View File

@ -151,6 +151,15 @@
"normalize-path": "2.1.1"
}
},
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
"sprintf-js": "1.0.3"
}
},
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
@ -205,6 +214,59 @@
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
"dev": true
},
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"dev": true,
"requires": {
"chalk": "1.1.3",
"esutils": "2.0.2",
"js-tokens": "3.0.2"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "2.2.1",
"escape-string-regexp": "1.0.5",
"has-ansi": "2.0.0",
"strip-ansi": "3.0.1",
"supports-color": "2.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
},
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
}
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@ -411,6 +473,12 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"commander": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -522,6 +590,36 @@
"rimraf": "2.6.2"
}
},
"diff": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz",
"integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==",
"dev": true
},
"doctrine": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz",
"integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=",
"dev": true,
"requires": {
"esutils": "1.1.6",
"isarray": "0.0.1"
},
"dependencies": {
"esutils": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz",
"integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=",
"dev": true
},
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
}
}
},
"dot-prop": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
@ -558,6 +656,18 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
"dev": true
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"execa": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz",
@ -1846,12 +1956,6 @@
"through": "2.3.8"
}
},
"ionicons": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-3.0.0.tgz",
"integrity": "sha1-QLja9P16MRUL0AIWD2ZJbiKpjDw=",
"dev": true
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
@ -2059,6 +2163,22 @@
"integrity": "sha1-VPzPYupl5PRyB1cri3jBs9neX3c=",
"dev": true
},
"js-tokens": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
"js-yaml": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
"integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==",
"dev": true,
"requires": {
"argparse": "1.0.10",
"esprima": "4.0.0"
}
},
"json-parse-better-errors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz",
@ -2905,6 +3025,12 @@
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
},
"path-type": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
@ -3125,6 +3251,15 @@
"is-finite": "1.0.2"
}
},
"resolve": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz",
"integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==",
"dev": true,
"requires": {
"path-parse": "1.0.5"
}
},
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
@ -3287,6 +3422,12 @@
"through": "2.3.8"
}
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
"stream-to-observable": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.2.0.tgz",
@ -3452,6 +3593,63 @@
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==",
"dev": true
},
"tslint": {
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.9.1.tgz",
"integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=",
"dev": true,
"requires": {
"babel-code-frame": "6.26.0",
"builtin-modules": "1.1.1",
"chalk": "2.3.1",
"commander": "2.14.1",
"diff": "3.4.0",
"glob": "7.1.2",
"js-yaml": "3.10.0",
"minimatch": "3.0.4",
"resolve": "1.5.0",
"semver": "5.5.0",
"tslib": "1.9.0",
"tsutils": "2.22.0"
}
},
"tslint-eslint-rules": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-4.1.1.tgz",
"integrity": "sha1-fDDniC8mvCdr/5HSOEl1xp2viLo=",
"dev": true,
"requires": {
"doctrine": "0.7.2",
"tslib": "1.9.0",
"tsutils": "1.9.1"
},
"dependencies": {
"tsutils": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-1.9.1.tgz",
"integrity": "sha1-ufmrROVa+WgYMdXyjQrur1x1DLA=",
"dev": true
}
}
},
"tslint-ionic-rules": {
"version": "0.0.13",
"resolved": "https://registry.npmjs.org/tslint-ionic-rules/-/tslint-ionic-rules-0.0.13.tgz",
"integrity": "sha512-wBQbKjLlazwTW9Ql2sZYdZ04cPYCaHSdo8PuJy9Ke9d4ewyjCRweJ8AB0OKtk3MtSuNiJJumnJJYUgNGuNjevg==",
"dev": true,
"requires": {
"tslint-eslint-rules": "4.1.1"
}
},
"tsutils": {
"version": "2.22.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.22.0.tgz",
"integrity": "sha512-05iMIQXsLVBx2vPTvpsHriRuNpKpU1Z9jqYUOBvwglO6I+QzdA1UQcVoNhsVkSZfns5TjFMFbdxdrkOW6cfwUQ==",
"dev": true,
"requires": {
"tslib": "1.9.0"
}
},
"typescript": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz",

View File

@ -24,6 +24,7 @@
"clean-generated": "node ./scripts/clean.js",
"compile": "./node_modules/.bin/ngc",
"deploy": "npm run build && np --any-branch",
"lint": "tslint --project .",
"tsc": "tsc -p ."
},
"main": "./dist/index.js",
@ -43,10 +44,11 @@
"@angular/router": "latest",
"@ionic/core": "next",
"glob": "7.1.2",
"ionicons": "~3.0.0",
"np": "^2.20.1",
"rimraf": "^2.6.2",
"rxjs": "5.5.2",
"tslint": "^5.8.0",
"tslint-ionic-rules": "0.0.13",
"typescript": "latest",
"zone.js": "0.8.18"
}

View File

@ -16,8 +16,8 @@ import { setIonicClasses } from './util/set-ionic-classes';
})
export class BooleanValueAccessor implements ControlValueAccessor {
constructor(private element: ElementRef, private renderer: Renderer2) {
this.onChange = () => { };
this.onTouched = () => { };
this.onChange = () => {/**/};
this.onTouched = () => {/**/};
}
onChange: (value: any) => void;

View File

@ -16,8 +16,8 @@ import { setIonicClasses } from './util/set-ionic-classes';
})
export class NumericValueAccessor implements ControlValueAccessor {
constructor(private element: ElementRef, private renderer: Renderer2) {
this.onChange = () => { };
this.onTouched = () => { };
this.onChange = () => {/**/};
this.onTouched = () => {/**/};
}
onChange: (value: any) => void;

View File

@ -21,8 +21,8 @@ export class RadioValueAccessor implements ControlValueAccessor {
onTouched: () => void;
constructor(private element: ElementRef, private renderer: Renderer2) {
this.onChange = () => { };
this.onTouched = () => { };
this.onChange = () => {/**/};
this.onTouched = () => {/**/};
}
writeValue(value: any) {

View File

@ -18,8 +18,8 @@ import { setIonicClasses } from './util/set-ionic-classes';
})
export class SelectValueAccessor implements ControlValueAccessor {
constructor(private element: ElementRef, private renderer: Renderer2) {
this.onChange = () => { };
this.onTouched = () => { };
this.onChange = () => {/**/};
this.onTouched = () => {/**/};
}
onChange: (value: any) => void;

View File

@ -16,8 +16,8 @@ import { setIonicClasses } from './util/set-ionic-classes';
})
export class TextValueAccessor implements ControlValueAccessor {
constructor(private element: ElementRef, private renderer: Renderer2) {
this.onChange = () => { };
this.onTouched = () => { };
this.onChange = () => {/**/};
this.onTouched = () => {/**/};
}
onChange: (value: any) => void;

View File

@ -25,7 +25,7 @@ export function getProviders(element: HTMLElement, data: any) {
{
provide: NavParams, useFactory: provideNavParamsInjectable, deps: [NavParamsToken]
},
]
];
}
export function provideNavControllerInjectable(element: HTMLIonNavElement) {

View File

@ -3,7 +3,6 @@ import {
Directive,
ElementRef,
Injector,
Optional,
Type,
} from '@angular/core';
@ -11,8 +10,6 @@ import { FrameworkDelegate } from '@ionic/core';
import { AngularComponentMounter, AngularEscapeHatch } from '..';
let id = 0;
@Directive({
selector: 'ion-nav',
})
@ -45,4 +42,4 @@ export class IonNav implements FrameworkDelegate {
return this.angularComponentMounter.removeViewFromDom(parentElement, childElement);
}
}
}

View File

@ -1,4 +1,4 @@
import { EmbeddedViewRef, AfterContentInit, ContentChild, Directive, ElementRef, Input, IterableDiffers, TrackByFunction, ChangeDetectorRef } from '@angular/core';
import { ChangeDetectorRef, ContentChild, Directive, ElementRef, EmbeddedViewRef } from '@angular/core';
import { VirtualItem } from './virtual-item';
import { VirtualHeader } from './virtual-header';
import { VirtualFooter } from './virtual-footer';
@ -15,7 +15,7 @@ export class VirtualScroll {
constructor(
private el: ElementRef,
private cd: ChangeDetectorRef,
public cd: ChangeDetectorRef,
) {
this.el.nativeElement.itemRender = this.itemRender.bind(this);
}
@ -39,7 +39,7 @@ export class VirtualScroll {
}
private getComponent(type: number) {
switch(type) {
switch (type) {
case 0: return this.itmTmp.templateRef;
case 1: return this.hdrTmp.templateRef;
case 2: return this.ftrTmp.templateRef;
@ -50,7 +50,7 @@ export class VirtualScroll {
function getElement(view: EmbeddedViewRef<VirtualContext>): HTMLElement {
const rootNodes = view.rootNodes;
for (var i = 0; i < rootNodes.length; i++) {
for (let i = 0; i < rootNodes.length; i++) {
if (rootNodes[i].nodeType === 1) {
return rootNodes[i];
}

View File

@ -28,4 +28,4 @@ export { Platform } from './providers/platform';
export { PopoverController, PopoverProxy } from './providers/popover-controller';
export { ToastController, ToastProxy } from './providers/toast-controller';
export * from './types/interfaces';
export * from './types/interfaces';

View File

@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import {
CUSTOM_ELEMENTS_SCHEMA,
ModuleWithProviders,
NgModule,
CUSTOM_ELEMENTS_SCHEMA
NgModule
} from '@angular/core';
import { BooleanValueAccessor } from './control-value-accessors/boolean-value-accessor';

View File

@ -12,20 +12,20 @@ export class ActionSheetController {
}
}
export function getActionSheetProxy(opts: ActionSheetOptions){
export function getActionSheetProxy(opts: ActionSheetOptions) {
return {
id: actionSheetId++,
state: PRESENTING,
opts: opts,
present: function() { return present(this)},
dismiss: function() { return dismiss(this)},
present: function() { return present(this); },
dismiss: function() { return dismiss(this); },
onDidDismiss: function(callback: (data: any, role: string) => void) {
(this as ActionSheetProxyInternal).onDidDismissHandler = callback;
},
onWillDismiss: function(callback: (data: any, role: string) => void) {
(this as ActionSheetProxyInternal).onWillDismissHandler = callback;
},
}
};
}
export function present(actionSheetProxy: ActionSheetProxyInternal): Promise<any> {
@ -82,8 +82,8 @@ export function loadOverlay(opts: ActionSheetOptions): Promise<HTMLIonActionShee
}
export interface ActionSheetProxy {
present(): Promise<void>
dismiss(): Promise<void>
present(): Promise<void>;
dismiss(): Promise<void>;
onDidDismiss(callback: (data: any, role: string) => void): void;
onWillDismiss(callback: (data: any, role: string) => void): void;
}
@ -101,4 +101,4 @@ export const PRESENTING = 1;
export const DISMISSING = 2;
const ION_ACTION_SHEET_DID_DISMISS_EVENT = 'ionActionSheetDidDismiss';
const ION_ACTION_SHEET_WILL_DISMISS_EVENT = 'ionActionSheetWillDismiss';
const ION_ACTION_SHEET_WILL_DISMISS_EVENT = 'ionActionSheetWillDismiss';

View File

@ -12,20 +12,20 @@ export class AlertController {
}
}
export function getAlertProxy(opts: AlertOptions){
export function getAlertProxy(opts: AlertOptions) {
return {
id: alertId++,
state: PRESENTING,
opts: opts,
present: function() { return present(this)},
dismiss: function() { return dismiss(this)},
present: function() { return present(this); },
dismiss: function() { return dismiss(this); },
onDidDismiss: function(callback: (data: any, role: string) => void) {
(this as AlertProxyInternal).onDidDismissHandler = callback;
},
onWillDismiss: function(callback: (data: any, role: string) => void) {
(this as AlertProxyInternal).onWillDismissHandler = callback;
},
}
};
}
export function present(alertProxy: AlertProxyInternal): Promise<any> {
@ -82,8 +82,8 @@ export function loadOverlay(opts: AlertOptions): Promise<HTMLIonAlertElement> {
}
export interface AlertProxy {
present(): Promise<void>
dismiss(): Promise<void>
present(): Promise<void>;
dismiss(): Promise<void>;
onDidDismiss(callback: (data: any, role: string) => void): void;
onWillDismiss(callback: (data: any, role: string) => void): void;
}
@ -101,4 +101,4 @@ export const PRESENTING = 1;
export const DISMISSING = 2;
const ION_ALERT_DID_DISMISS_EVENT = 'ionAlertDidDismiss';
const ION_ALERT_WILL_DISMISS_EVENT = 'ionAlertWillDismiss';
const ION_ALERT_WILL_DISMISS_EVENT = 'ionAlertWillDismiss';

View File

@ -90,4 +90,4 @@ export function getNavByIdOrNameAsyncImpl(app: App, nameOrId: number | string):
return app._element.componentOnReady().then(() => {
return app._element.getNavByIdOrName(nameOrId);
});
}
}

View File

@ -30,4 +30,4 @@ function getElement(): Promise<HTMLIonEventsElement> {
});
}
const ELEMENT_NAME = 'ion-events';
const ELEMENT_NAME = 'ion-events';

View File

@ -12,20 +12,20 @@ export class LoadingController {
}
}
export function getLoadingProxy(opts: LoadingOptions){
export function getLoadingProxy(opts: LoadingOptions) {
return {
id: loadingId++,
state: PRESENTING,
opts: opts,
present: function() { return present(this)},
dismiss: function() { return dismiss(this)},
present: function() { return present(this); },
dismiss: function() { return dismiss(this); },
onDidDismiss: function(callback: (data: any, role: string) => void) {
(this as LoadingProxyInternal).onDidDismissHandler = callback;
},
onWillDismiss: function(callback: (data: any, role: string) => void) {
(this as LoadingProxyInternal).onWillDismissHandler = callback;
},
}
};
}
export function present(loadingProxy: LoadingProxyInternal): Promise<any> {
@ -82,8 +82,8 @@ export function loadOverlay(opts: LoadingOptions): Promise<HTMLIonLoadingElement
}
export interface LoadingProxy {
present(): Promise<void>
dismiss(): Promise<void>
present(): Promise<void>;
dismiss(): Promise<void>;
onDidDismiss(callback: (data: any, role: string) => void): void;
onWillDismiss(callback: (data: any, role: string) => void): void;
}
@ -101,4 +101,4 @@ export const PRESENTING = 1;
export const DISMISSING = 2;
const ION_LOADING_DID_DISMISS_EVENT = 'ionLoadingDidDismiss';
const ION_LOADING_WILL_DISMISS_EVENT = 'ionLoadingWillDismiss';
const ION_LOADING_WILL_DISMISS_EVENT = 'ionLoadingWillDismiss';

View File

@ -93,7 +93,7 @@ export class MenuController {
return false;
}
isOpenAsync(menuId?: string): Promise<boolean>{
isOpenAsync(menuId?: string): Promise<boolean> {
return element.componentOnReady().then(() => {
return element.isOpen(menuId);
});
@ -124,4 +124,4 @@ export class MenuController {
return element.toggle(menuId);
});
}
}
}

View File

@ -120,4 +120,4 @@ export class NavController implements PublicNav {
}
return [];
}
}
}

View File

@ -5,7 +5,7 @@ export type DocumentDirection = 'ltr' | 'rtl';
let dir: DocumentDirection = 'ltr';
let isRtl = false;
let lang: string = '';
let lang = '';
export class Platform {
@ -225,4 +225,4 @@ export function getHydratedPlatform(platform: Platform): Promise<HTMLIonPlatform
});
}
return platform._element.componentOnReady();
}
}

View File

@ -12,20 +12,20 @@ export class ToastController {
}
}
export function getToastProxy(opts: ToastOptions){
export function getToastProxy(opts: ToastOptions) {
return {
id: toastId++,
state: PRESENTING,
opts: opts,
present: function() { return present(this)},
dismiss: function() { return dismiss(this)},
present: function() { return present(this); },
dismiss: function() { return dismiss(this); },
onDidDismiss: function(callback: (data: any, role: string) => void) {
(this as ToastProxyInternal).onDidDismissHandler = callback;
},
onWillDismiss: function(callback: (data: any, role: string) => void) {
(this as ToastProxyInternal).onWillDismissHandler = callback;
},
}
};
}
export function present(toastProxy: ToastProxyInternal): Promise<any> {
@ -82,8 +82,8 @@ export function loadOverlay(opts: ToastOptions): Promise<HTMLIonToastElement> {
}
export interface ToastProxy {
present(): Promise<void>
dismiss(): Promise<void>
present(): Promise<void>;
dismiss(): Promise<void>;
onDidDismiss(callback: (data: any, role: string) => void): void;
onWillDismiss(callback: (data: any, role: string) => void): void;
}
@ -101,4 +101,4 @@ export const PRESENTING = 1;
export const DISMISSING = 2;
const ION_TOAST_DID_DISMISS_EVENT = 'ionToastDidDismiss';
const ION_TOAST_WILL_DISMISS_EVENT = 'ionToastWillDismiss';
const ION_TOAST_WILL_DISMISS_EVENT = 'ionToastWillDismiss';

View File

@ -14,10 +14,10 @@ import {
} from '@angular/router';
import {
TreeNode,
advanceActivatedRoute,
forEach,
nodeChildrenAsMap,
TreeNode
nodeChildrenAsMap
} from './router-utils';
export class AsyncActivateRoutes {
@ -64,7 +64,7 @@ export class AsyncActivateRoutes {
() => {
const promises: Promise<void>[] = [];
// De-activate the routes that will not be re-used
forEach(children, (v: TreeNode<ActivatedRoute>, childName: string) => {
forEach(children, (v: TreeNode<ActivatedRoute>) => {
promises.push(this.deactivateRouteAndItsChildren(v, contexts));
});
@ -135,7 +135,7 @@ export class AsyncActivateRoutes {
const contexts = route.value.component ? context.children : parentContexts;
const promises: Promise<void>[] = [];
forEach(children, (v: any, k: string) => {
forEach(children, (v: any) => {
promises.push(this.deactivateRouteAndItsChildren(v, contexts));
});

View File

@ -42,7 +42,7 @@ export function monkeyPatchRouter(router: any) {
}
}
routes.push(new AsyncActivateRoutes(router.routeReuseStrategy, state, storedState, (evt: Event) => router.triggerEvent(evt)))
routes.push(new AsyncActivateRoutes(router.routeReuseStrategy, state, storedState, (evt: Event) => router.triggerEvent(evt)));
})
@ -83,7 +83,7 @@ export function monkeyPatchRouter(router: any) {
resolvePromise(false);
} else {
router.resetStateAndUrl(storedState, storedUrl, rawUrl);
(router.events as any as Subject<Event>)
(router.events as Subject<Event>)
.next(new NavigationError(id, router.serializeUrl(url), e));
try {
resolvePromise(router.errorHandler(e));
@ -100,4 +100,4 @@ function isNavigationCancelingError(error: any) {
return error && (/** @type {?} */ (error))[NAVIGATION_CANCELING_ERROR];
}
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';

View File

@ -20,4 +20,4 @@ export class OutletInjector implements Injector {
return this.parent.get(token, notFoundValue);
}
}
}

View File

@ -7,7 +7,6 @@ import {
ElementRef,
EventEmitter,
Injector,
NgZone,
OnDestroy,
OnInit,
Output,
@ -16,13 +15,13 @@ import {
} from '@angular/core';
import {
PRIMARY_OUTLET,
ActivatedRoute,
ChildrenOutletContexts,
PRIMARY_OUTLET,
Router
} from '@angular/router';
import { NavResult, RouterDelegate } from '@ionic/core';
import { RouterDelegate } from '@ionic/core';
import { OutletInjector } from './outlet-injector';
import { RouteEventHandler } from './route-event-handler';
@ -179,7 +178,7 @@ export function getDataFromRoute(activatedRoute: ActivatedRoute): Promise<any> {
promises.push(getDataFromObservable(activatedRoute));
promises.push(getDataFromParams(activatedRoute));
return Promise.all(promises).then(([data, params]: any[]) => {
let combined = {};
const combined = {};
Object.assign(combined, data, params);
return combined;
});
@ -199,4 +198,4 @@ export function getDataFromParams(activatedRoute: ActivatedRoute) {
resolve(data || {});
});
});
}
}

View File

@ -38,4 +38,4 @@ export interface PushPopOutletContext {
resolver?: ComponentFactoryResolver;
children?: PushPopOutletContexts;
attachRef: ComponentRef<any>;
}
}

View File

@ -10,7 +10,7 @@ import { getIonApp } from '../util/util';
@Injectable()
export class RouteEventHandler {
constructor(private router: Router) {
constructor(public router: Router) {
router.events.subscribe((event: Event) => {
if (event instanceof NavigationEnd) {

View File

@ -15,13 +15,13 @@ import {
import {ɵgetDOM as getDOM} from '@angular/platform-browser';
import {
ROUTES,
ROUTER_CONFIGURATION,
ChildrenOutletContexts,
ExtraOptions,
ROUTER_CONFIGURATION,
ROUTES,
Route,
Router,
RouteReuseStrategy,
Router,
UrlHandlingStrategy,
UrlSerializer
} from '@angular/router';
@ -70,7 +70,7 @@ export class IonicRouterModule {
}
export function setupRouter(
ref: ApplicationRef, urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts,
_ref: ApplicationRef, urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts,
location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler,
config: Route[][], opts: ExtraOptions = {}, urlHandlingStrategy?: UrlHandlingStrategy,
routeReuseStrategy?: RouteReuseStrategy) {
@ -96,7 +96,7 @@ if (opts.errorHandler) {
if (opts.enableTracing) {
const dom = getDOM();
router.events.subscribe((e: any) => {
dom.logGroup(`Router Event: ${(<any>e.constructor).name}`);
dom.logGroup(`Router Event: ${(e.constructor).name}`);
dom.log(e.toString());
dom.log(e);
dom.logGroupEnd();
@ -112,4 +112,4 @@ if (opts.paramsInheritanceStrategy) {
}
return router;
}
}

View File

@ -8,7 +8,7 @@ export function nodeChildrenAsMap<T extends{outlet: string}>(node: TreeNode<T>|
return map;
}
export function forEach<K, V>(map: {[key: string]: V}, callback: (v: V, k: string) => void): void {
export function forEach<_K, V>(map: {[key: string]: V}, callback: (v: V, k: string) => void): void {
for (const prop in map) {
if (map.hasOwnProperty(prop)) {
callback(map[prop], prop);
@ -30,28 +30,28 @@ export class TreeNode<T> {
export function advanceActivatedRoute(route: any): void {
if (route.snapshot) {
const currentSnapshot = route.snapshot;
const nextSnapshot = (route as any)._futureSnapshot;
const nextSnapshot = (route)._futureSnapshot;
route.snapshot = nextSnapshot;
if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) {
(<any>route.queryParams).next(nextSnapshot.queryParams);
(route.queryParams).next(nextSnapshot.queryParams);
}
if (currentSnapshot.fragment !== nextSnapshot.fragment) {
(<any>route.fragment).next(nextSnapshot.fragment);
(route.fragment).next(nextSnapshot.fragment);
}
if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) {
(<any>route.params).next(nextSnapshot.params);
(route.params).next(nextSnapshot.params);
}
if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) {
(<any>route.url).next(nextSnapshot.url);
(route.url).next(nextSnapshot.url);
}
if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) {
(<any>route.data).next(nextSnapshot.data);
(route.data).next(nextSnapshot.data);
}
} else {
route.snapshot = (route as any)._futureSnapshot;
route.snapshot = (route)._futureSnapshot;
// this is for resolved data
(<any>route.data).next((route as any)._futureSnapshot.data);
(route.data).next((route)._futureSnapshot.data);
}
}
@ -66,6 +66,7 @@ export function shallowEqualArrays(a: any[], b: any[]): boolean {
export function shallowEqual(a: {[x: string]: any}, b: {[x: string]: any}): boolean {
const k1 = Object.keys(a);
const k2 = Object.keys(b);
/*tslint:disable*/
if (k1.length != k2.length) {
return false;
}
@ -81,4 +82,4 @@ export function shallowEqual(a: {[x: string]: any}, b: {[x: string]: any}): bool
export function flatten<T>(arr: T[][]): T[] {
return Array.prototype.concat.apply([], arr);
}
}

View File

@ -20,4 +20,4 @@ export interface AngularEscapeHatch extends EscapeHatch {
activatedRoute?: ActivatedRoute;
cfr?: ComponentFactoryResolver;
injector?: Injector;
}
}

View File

@ -29,4 +29,4 @@ export function isString(something: any) {
export function getIonApp(): Promise<HTMLIonAppElement> {
const element = ensureElementInBody('ion-app') as HTMLIonAppElement;
return element.componentOnReady();
}
}

View File

@ -1,7 +1,8 @@
{
"compilerOptions": {
"allowUnreachableCode": false,
"alwaysStrict": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
@ -13,17 +14,16 @@
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"pretty": true,
"removeComments": false,
"rootDir": "src",
"sourceMap": true,
"target": "es2015",
"rootDir": "src"
"target": "es2015"
},
"files": [
"src/index.ts"
],
"compileOnSave": false,
"buildOnSave": false
]
}