chore: removed deprecated APIs

This commit is contained in:
Manu Mtz.-Almeida
2016-10-13 18:02:45 +02:00
committed by Adam Bradley
parent a06bd69926
commit 35568ba85f
11 changed files with 22 additions and 190 deletions

View File

@ -61,15 +61,6 @@ export class ActionSheet extends ViewController {
return this._app.present(this, navOptions); return this._app.present(this, navOptions);
} }
/**
* @private
* DEPRECATED: Please inject ActionSheetController instead
*/
static create(opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('ActionSheet.create(..) has been deprecated. Please inject ActionSheetController instead');
}
} }

View File

@ -84,15 +84,6 @@ export class Alert extends ViewController {
return this._app.present(this, navOptions); return this._app.present(this, navOptions);
} }
/**
* @private
* DEPRECATED: Please inject AlertController instead
*/
static create(opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Alert.create(..) has been deprecated. Please inject AlertController instead');
}
} }

View File

@ -55,15 +55,6 @@ export class Loading extends ViewController {
this._nav && this._nav.popAll(); this._nav && this._nav.popAll();
} }
/**
* @private
* DEPRECATED: Please inject LoadingController instead
*/
static create(opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Loading.create(..) has been deprecated. Please inject LoadingController instead');
}
} }

View File

@ -44,14 +44,6 @@ export class Modal extends ViewController {
return this._app.present(this, navOptions, AppPortal.MODAL); return this._app.present(this, navOptions, AppPortal.MODAL);
} }
/**
* @private
* DEPRECATED: Please inject ModalController instead
*/
static create(cmp: any, opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Modal.create(..) has been deprecated. Please inject ModalController instead');
}
} }

View File

@ -74,15 +74,6 @@ export class Picker extends ViewController {
return this._app.present(this, navOptions); return this._app.present(this, navOptions);
} }
/**
* @private
* DEPRECATED: Please inject PickerController instead
*/
static create(opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Picker.create(..) has been deprecated. Please inject PickerController instead');
}
} }

View File

@ -43,15 +43,6 @@ export class Popover extends ViewController {
return this._app.present(this, navOptions); return this._app.present(this, navOptions);
} }
/**
* @private
* DEPRECATED: Please inject PopoverController instead
*/
static create(component: any, data = {}, opts: PopoverOptions = {}) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Popover.create(..) has been deprecated. Please inject PopoverController instead');
}
} }

View File

@ -39,11 +39,6 @@ export class TabButton extends Ion implements OnInit {
this.disHover = (config.get('hoverCSS') === false); this.disHover = (config.get('hoverCSS') === false);
this.layout = config.get('tabsLayout'); this.layout = config.get('tabsLayout');
// TODO deprecated 07-07-2016 beta.11
if (config.get('tabbarLayout') !== undefined) {
this.layout = config.get('tabbarLayout');
}
} }
ngOnInit() { ngOnInit() {

View File

@ -192,21 +192,11 @@ export class Tabs extends Ion implements AfterViewInit {
*/ */
@Input() selectedIndex: number; @Input() selectedIndex: number;
/**
* @internal DEPRECATED. Please use `tabsLayout` instead.
*/
@Input() private tabbarLayout: string;
/** /**
* @input {string} Set the tabbar layout: `icon-top`, `icon-left`, `icon-right`, `icon-bottom`, `icon-hide`, `title-hide`. * @input {string} Set the tabbar layout: `icon-top`, `icon-left`, `icon-right`, `icon-bottom`, `icon-hide`, `title-hide`.
*/ */
@Input() tabsLayout: string; @Input() tabsLayout: string;
/**
* @internal DEPRECATED. Please use `tabsPlacement` instead.
*/
@Input() private tabbarPlacement: string;
/** /**
* @input {string} Set position of the tabbar: `top`, `bottom`. * @input {string} Set position of the tabbar: `top`, `bottom`.
*/ */
@ -261,18 +251,6 @@ export class Tabs extends Ion implements AfterViewInit {
this._subPages = config.getBoolean('tabsHideOnSubPages'); this._subPages = config.getBoolean('tabsHideOnSubPages');
this.tabsHighlight = config.getBoolean('tabsHighlight'); this.tabsHighlight = config.getBoolean('tabsHighlight');
// TODO deprecated 07-07-2016 beta.11
if (config.get('tabSubPages') !== null) {
console.warn('Config option "tabSubPages" has been deprecated. Please use "tabsHideOnSubPages" instead.');
this._subPages = config.getBoolean('tabSubPages');
}
// TODO deprecated 07-07-2016 beta.11
if (config.get('tabbarHighlight') !== null) {
console.warn('Config option "tabbarHighlight" has been deprecated. Please use "tabsHighlight" instead.');
this.tabsHighlight = config.getBoolean('tabbarHighlight');
}
if (this.parent) { if (this.parent) {
// this Tabs has a parent Nav // this Tabs has a parent Nav
this.parent.registerChildNav(this); this.parent.registerChildNav(this);
@ -308,36 +286,6 @@ export class Tabs extends Ion implements AfterViewInit {
this._setConfig('tabsLayout', 'icon-top'); this._setConfig('tabsLayout', 'icon-top');
this._setConfig('tabsHighlight', this.tabsHighlight); this._setConfig('tabsHighlight', this.tabsHighlight);
// TODO deprecated 07-07-2016 beta.11
this._setConfig('tabbarPlacement', 'bottom');
this._setConfig('tabbarLayout', 'icon-top');
// TODO deprecated 07-07-2016 beta.11
if (this.tabbarPlacement !== undefined) {
console.warn('Input "tabbarPlacement" has been deprecated. Please use "tabsPlacement" instead.');
this.setElementAttribute('tabsPlacement', this.tabbarPlacement);
this.tabsPlacement = this.tabbarPlacement;
}
// TODO deprecated 07-07-2016 beta.11
if (this._config.get('tabbarPlacement') !== null) {
console.warn('Config option "tabbarPlacement" has been deprecated. Please use "tabsPlacement" instead.');
this.setElementAttribute('tabsPlacement', this._config.get('tabbarPlacement'));
}
// TODO deprecated 07-07-2016 beta.11
if (this.tabbarLayout !== undefined) {
console.warn('Input "tabbarLayout" has been deprecated. Please use "tabsLayout" instead.');
this.setElementAttribute('tabsLayout', this.tabbarLayout);
this.tabsLayout = this.tabbarLayout;
}
// TODO deprecated 07-07-2016 beta.11
if (this._config.get('tabbarLayout') !== null) {
console.warn('Config option "tabbarLayout" has been deprecated. Please use "tabsLayout" instead.');
this.setElementAttribute('tabsLayout', this._config.get('tabsLayout'));
}
if (this.tabsHighlight) { if (this.tabsHighlight) {
this._platform.onResize(() => { this._platform.onResize(() => {
this._highlight.select(this.getSelected()); this._highlight.select(this.getSelected());

View File

@ -66,15 +66,6 @@ export class Toast extends ViewController {
this._nav && this._nav.popAll(); this._nav && this._nav.popAll();
} }
/**
* @private
* DEPRECATED: Please inject ToastController instead
*/
static create(opt: any) {
// deprecated warning: added beta.11 2016-06-27
console.warn('Toast.create(..) has been deprecated. Please inject ToastController instead');
}
} }

View File

@ -883,6 +883,9 @@ export class NavControllerBase extends Ion implements NavController {
} }
isTransitioning(): boolean { isTransitioning(): boolean {
if (this._trnsTm === 0) {
return false;
}
// using a timestamp instead of boolean incase something goes wrong // using a timestamp instead of boolean incase something goes wrong
return (this._trnsTm > Date.now()); return (this._trnsTm > Date.now());
} }
@ -954,28 +957,6 @@ export class NavControllerBase extends Ion implements NavController {
this._viewport = val; this._viewport = val;
} }
/**
* @private
* DEPRECATED: Please use app.getRootNav() instead
*/
get rootNav(): NavController {
// deprecated 07-14-2016 beta.11
console.warn('nav.rootNav() has been deprecated, please use app.getRootNav() instead');
return this._app.getRootNav();
}
/**
* @private
* DEPRECATED: Please use inject the overlays controller and use the present method on the instance instead.
*/
present(): Promise<any> {
// deprecated warning: added beta.11 2016-06-27
console.warn('nav.present() has been deprecated.\n' +
'Please inject the overlay\'s controller and use the present method on the instance instead.');
return Promise.resolve();
}
} }
let ctrlIds = -1; let ctrlIds = -1;

View File

@ -147,16 +147,6 @@ export class ViewController {
this._emitter.emit(data); this._emitter.emit(data);
} }
/**
* @private
* onDismiss(..) has been deprecated. Please use onDidDismiss(..) instead
*/
onDismiss(callback: Function) {
// deprecated warning: added beta.11 2016-06-30
console.warn('onDismiss(..) has been deprecated. Please use onDidDismiss(..) instead');
this.onDidDismiss(callback);
}
/** /**
* Called when the current viewController has be successfully dismissed * Called when the current viewController has be successfully dismissed
*/ */
@ -412,7 +402,7 @@ export class ViewController {
* @private * @private
*/ */
_willLoad() { _willLoad() {
ctrlFn(this, 'WillLoad'); this._lifecycle('WillLoad');
} }
/** /**
@ -424,17 +414,7 @@ export class ViewController {
* recommended method to use when a view becomes active. * recommended method to use when a view becomes active.
*/ */
_didLoad() { _didLoad() {
// deprecated warning: added 2016-08-14, beta.12 this._lifecycle('DidLoad');
if (this.instance && this.instance.ionViewLoaded) {
try {
console.warn('ionViewLoaded() has been deprecated. Please rename to ionViewDidLoad()');
this.instance.ionViewLoaded();
} catch (e) {
console.error(this.name + ' iionViewLoaded: ' + e.message);
}
}
ctrlFn(this, 'DidLoad');
} }
/** /**
@ -449,7 +429,7 @@ export class ViewController {
} }
this.willEnter.emit(null); this.willEnter.emit(null);
ctrlFn(this, 'WillEnter'); this._lifecycle('WillEnter');
} }
/** /**
@ -460,7 +440,7 @@ export class ViewController {
_didEnter() { _didEnter() {
this._nb && this._nb.didEnter(); this._nb && this._nb.didEnter();
this.didEnter.emit(null); this.didEnter.emit(null);
ctrlFn(this, 'DidEnter'); this._lifecycle('DidEnter');
} }
/** /**
@ -469,7 +449,7 @@ export class ViewController {
*/ */
_willLeave() { _willLeave() {
this.willLeave.emit(null); this.willLeave.emit(null);
ctrlFn(this, 'WillLeave'); this._lifecycle('WillLeave');
} }
/** /**
@ -479,7 +459,7 @@ export class ViewController {
*/ */
_didLeave() { _didLeave() {
this.didLeave.emit(null); this.didLeave.emit(null);
ctrlFn(this, 'DidLeave'); this._lifecycle('DidLeave');
// when this is not the active page // when this is not the active page
// we no longer need to detect changes // we no longer need to detect changes
@ -494,17 +474,7 @@ export class ViewController {
*/ */
_willUnload() { _willUnload() {
this.willUnload.emit(null); this.willUnload.emit(null);
ctrlFn(this, 'WillUnload'); this._lifecycle('WillUnload');
// deprecated warning: added 2016-08-14, beta.12
if (this.instance && this.instance.ionViewDidUnload) {
console.warn('ionViewDidUnload() has been deprecated. Please use ionViewWillUnload() instead');
try {
this.instance.ionViewDidUnload();
} catch (e) {
console.error(this.name + ' ionViewDidUnload: ' + e.message);
}
}
} }
/** /**
@ -516,8 +486,9 @@ export class ViewController {
if (renderer) { if (renderer) {
// ensure the element is cleaned up for when the view pool reuses this element // ensure the element is cleaned up for when the view pool reuses this element
// ******** DOM WRITE **************** // ******** DOM WRITE ****************
renderer.setElementAttribute(this._cmp.location.nativeElement, 'class', null); const cmpEle = this._cmp.location.nativeElement;
renderer.setElementAttribute(this._cmp.location.nativeElement, 'style', null); renderer.setElementAttribute(cmpEle, 'class', null);
renderer.setElementAttribute(cmpEle, 'style', null);
} }
// completely destroy this component. boom. // completely destroy this component. boom.
@ -546,27 +517,26 @@ export class ViewController {
return instance[methodName](); return instance[methodName]();
} catch (e) { } catch (e) {
console.error(`${this.name} ionViewCan${lifecycle} error: ${e}`); console.error(`${this.name} ${methodName} error: ${e.message}`);
return false; return false;
} }
} }
return true; return true;
} }
} _lifecycle(lifecycle: string) {
let instance = this.instance;
let methodName = 'ionView' + lifecycle;
function ctrlFn(viewCtrl: ViewController, fnName: string) { if (instance && instance[methodName]) {
if (viewCtrl.instance) {
// fire off ionView lifecycle instance method
if (viewCtrl.instance['ionView' + fnName]) {
try { try {
viewCtrl.instance['ionView' + fnName](); instance[methodName]();
} catch (e) { } catch (e) {
console.error(viewCtrl.name + ' ionView' + fnName + ': ' + e.message); console.error(`${this.name} ${methodName} error: ${e.message}`);
} }
} }
} }
} }