fix(nav-controller): remove duplicated swipeBackEnabled input

This commit is contained in:
Manuel Mtz-Almeida
2017-03-23 23:34:31 +01:00
parent 682ce49592
commit 404d977c81
4 changed files with 17 additions and 26 deletions

View File

@ -5,7 +5,6 @@ import { Config } from '../../config/config';
import { DeepLinker } from '../../navigation/deep-linker'; import { DeepLinker } from '../../navigation/deep-linker';
import { DomController } from '../../platform/dom-controller'; import { DomController } from '../../platform/dom-controller';
import { GestureController } from '../../gestures/gesture-controller'; import { GestureController } from '../../gestures/gesture-controller';
import { isTrueProperty } from '../../util/util';
import { Keyboard } from '../../platform/keyboard'; import { Keyboard } from '../../platform/keyboard';
import { NavController } from '../../navigation/nav-controller'; import { NavController } from '../../navigation/nav-controller';
import { NavControllerBase } from '../../navigation/nav-controller-base'; import { NavControllerBase } from '../../navigation/nav-controller-base';
@ -56,6 +55,7 @@ import { RootNode } from '../split-pane/split-pane';
providers: [{provide: RootNode, useExisting: forwardRef(() => Nav) }] providers: [{provide: RootNode, useExisting: forwardRef(() => Nav) }]
}) })
export class Nav extends NavControllerBase implements AfterViewInit, RootNode { export class Nav extends NavControllerBase implements AfterViewInit, RootNode {
private _root: any; private _root: any;
private _hasInit: boolean = false; private _hasInit: boolean = false;
@ -149,18 +149,6 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode {
*/ */
@Input() rootParams: any; @Input() rootParams: any;
/**
* @input {boolean} If true, swipe to go back is enabled.
*/
@Input()
get swipeBackEnabled(): boolean {
return this._sbEnabled;
}
set swipeBackEnabled(val: boolean) {
this._sbEnabled = isTrueProperty(val);
this._swipeBackCheck();
}
/** /**
* @hidden * @hidden
*/ */

View File

@ -233,17 +233,6 @@ export class Tab extends NavControllerBase {
this._isShown = isTrueProperty(val); this._isShown = isTrueProperty(val);
} }
/**
* @input {boolean} If true, swipe to go back is enabled.
*/
@Input()
get swipeBackEnabled(): boolean {
return this._sbEnabled;
}
set swipeBackEnabled(val: boolean) {
this._sbEnabled = isTrueProperty(val);
}
/** /**
* @input {boolean} If true, hide the tabs on child pages. * @input {boolean} If true, hide the tabs on child pages.
*/ */

View File

@ -1,4 +1,4 @@
import { ComponentRef, ComponentFactoryResolver, ElementRef, EventEmitter, NgZone, ReflectiveInjector, Renderer, ViewContainerRef } from '@angular/core'; import { ComponentRef, Input, ComponentFactoryResolver, ElementRef, EventEmitter, NgZone, ReflectiveInjector, Renderer, ViewContainerRef } from '@angular/core';
import { AnimationOptions } from '../animations/animation'; import { AnimationOptions } from '../animations/animation';
import { App } from '../components/app/app'; import { App } from '../components/app/app';
@ -9,7 +9,7 @@ import { setZIndex } from './nav-util';
import { DeepLinker } from './deep-linker'; import { DeepLinker } from './deep-linker';
import { DomController } from '../platform/dom-controller'; import { DomController } from '../platform/dom-controller';
import { GestureController } from '../gestures/gesture-controller'; import { GestureController } from '../gestures/gesture-controller';
import { isBlank, isNumber, isPresent, assert, removeArrayItem } from '../util/util'; import { isBlank, isNumber, isPresent, isTrueProperty, assert, removeArrayItem } from '../util/util';
import { isViewController, ViewController } from './view-controller'; import { isViewController, ViewController } from './view-controller';
import { Ion } from '../components/ion'; import { Ion } from '../components/ion';
import { Keyboard } from '../platform/keyboard'; import { Keyboard } from '../platform/keyboard';
@ -49,6 +49,15 @@ export class NavControllerBase extends Ion implements NavController {
id: string; id: string;
@Input()
get swipeBackEnabled(): boolean {
return this._sbEnabled;
}
set swipeBackEnabled(val: boolean) {
this._sbEnabled = isTrueProperty(val);
this._swipeBackCheck();
}
constructor( constructor(
public parent: any, public parent: any,
public _app: App, public _app: App,

View File

@ -403,6 +403,11 @@ export abstract class NavController {
*/ */
config: Config; config: Config;
/**
* @input {boolean} If true, swipe to go back is enabled.
*/
swipeBackEnabled: boolean;
/** /**
* Push a new component onto the current navigation stack. Pass any aditional information * Push a new component onto the current navigation stack. Pass any aditional information
* along as an object. This additional information is accessible through NavParams * along as an object. This additional information is accessible through NavParams