refactor(all): make all method return a promise

This commit is contained in:
Manu Mtz.-Almeida
2018-08-28 18:16:10 +02:00
parent 5d32115684
commit 1d46973785
53 changed files with 304 additions and 439 deletions

View File

@ -42,7 +42,6 @@ See the [Tabs API Docs](../Tabs/) for more details on configuring Tabs.
| Method | Description |
| ----------- | ------------------------------------ |
| `getTabId` | Get the Id for the tab |
| `setActive` | Set the active component for the tab |

View File

@ -97,6 +97,11 @@ export class Tab {
@Event() ionTabMutated!: EventEmitter<void>;
componentWillLoad() {
// Set default name
if (!this.name && typeof this.component === 'string') {
this.name = this.component;
}
if (Build.isDev) {
if (this.component && this.el.childElementCount > 0) {
console.error('You can not use a lazy-loaded component in a tab and inlined content at the same time.' +
@ -118,18 +123,6 @@ export class Tab {
this.ionTabMutated.emit();
}
/** Get the Id for the tab */
@Method()
getTabId(): string | null {
if (this.name) {
return this.name;
}
if (typeof this.component === 'string') {
return this.component;
}
return null;
}
/** Set the active component for the tab */
@Method()
async setActive(): Promise<void> {