From a961dca7e8871b548c099fafff026772d055a399 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 13 Dec 2018 16:43:04 +0100 Subject: [PATCH] fix(angular): lint issue --- angular/src/directives/navigation/ion-tabs.ts | 12 +++++------- core/src/components/tab-button/tab-button.tsx | 7 +++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/angular/src/directives/navigation/ion-tabs.ts b/angular/src/directives/navigation/ion-tabs.ts index 959d075bd5..ea2c095e6b 100644 --- a/angular/src/directives/navigation/ion-tabs.ts +++ b/angular/src/directives/navigation/ion-tabs.ts @@ -59,13 +59,11 @@ export class IonTabs { @HostListener('ionTabButtonClick', ['$event.detail']) onTabButtonClick(detail: TabButtonClickDetail) { const { tab, selected } = detail; - if (tab) { - const href = `${this.outlet.tabsPrefix}/${tab}`; - const url = selected - ? href - : this.outlet.getLastUrl(tab) || href; + const href = `${this.outlet.tabsPrefix}/${tab}`; + const url = selected + ? href + : this.outlet.getLastUrl(tab) || href; - this.navCtrl.navigateBack(url, true); - } + this.navCtrl.navigateBack(url, true); } } diff --git a/core/src/components/tab-button/tab-button.tsx b/core/src/components/tab-button/tab-button.tsx index 3af515941c..ceb6e1f6cc 100644 --- a/core/src/components/tab-button/tab-button.tsx +++ b/core/src/components/tab-button/tab-button.tsx @@ -77,6 +77,9 @@ export class TabButton implements ComponentInterface { if (this.layout === undefined) { this.layout = this.config.get('tabButtonLayout', 'icon-top'); } + if (isNotDefined(this.tab)) { + console.error('Missing "tab" property in '); + } } private get hasLabel() { @@ -117,3 +120,7 @@ export class TabButton implements ComponentInterface { ); } } + +function isNotDefined(a: any) { + return a == null; +}