Skip to content

[v4-beta.18] Property 'select' does not exist on type 'IonTabs'. #16753

Closed

Description

@davidecheli

Bug Report

Ionic version:
[x] 4.x

Current behavior:
When I try to call the select method in the IonTabs, the following error is shown:
Property 'select' does not exist on type 'IonTabs'.

Expected behavior:
The method must select the tab that is in the param.

Steps to reproduce:
Try to call the select method from a tab reference.

Related code:

import { OnInit, ViewChild } from '@angular/core';

import { IonTabs } from '@ionic/angular';

@Component({
  selector: 'app-tab',
  templateUrl: './tabpage.html',
  styleUrls: ['./tab.page.scss'],
})
export class AbastecimentoLeituraPage implements OnInit {
  @ViewChild('myTabs') tabRef: IonTabs;

  constructor() { }

  ngOnInit() {
    this.tabRef.select('tabSelected');
  }
}

Other information:
The select method was working in the beta 17 version when I try to call in the Tabs.

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.5.0 (/Users/david/.npm-global/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.18
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.0.7
   @angular/cli                  : 7.1.3
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.3, (and 8 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/david/Library/Android/sdk)
   NodeJS            : v8.11.3 (/usr/local/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61

Activity

  1. paulstelzer commented on Dec 15, 2018

    @paulstelzer
    Contributor

    Thanks for your issue! You are right the select method is not available.

    At first I thought your issue is because you are using ViewChild and want to get access inside ngOnInit (Viewchild is available before AfterViewInit - https://angular.io/api/core/ViewChild ).

    But this isn't the case and so thanks for finding this issue!

    @manucorporat Inside the docs there are three methods for ion-tabs ( https://github.com/ionic-team/ionic/tree/master/core/src/components/tabs ), but these are not available. See the following screenshots:

    code_2018-12-15_12-05-53

    And no, it's not an issue of the interface:

    chrome_2018-12-15_12-06-33

  2. added
    package: core
    type: bug
    and removed on Dec 15, 2018
  3. hghammoud commented on Dec 16, 2018

    @hghammoud

    Can you please prioritise this issue?

    in our case we like to minimise the upgrades efforts in the future so we always merge the latest releases and adapt. Except for this one is breaking our app, and we are going to production soon.

    Thanks

  4. paulstelzer commented on Dec 16, 2018

    @paulstelzer
    Contributor

    You don't need to use "select" because you can just use the normal router navigation from Angular :)

  5. added a commit that references this issue on Dec 16, 2018
    045c1f9
  6. added a commit that references this issue on Dec 16, 2018
    56dd8ae
  7. hghammoud commented on Dec 17, 2018

    @hghammoud

    You don't need to use "select" because you can just use the normal router navigation from Angular :)

    That's you assuming that we are using the angular router navigation... since its was so buggy from the early beta version with lazyloading, ion-tabs, back() etc...
    we tried it at first but things didnt progress fast enough so we switched to the old system and we cant turn back now. Not for this release anyways.
    Thanks anyways ;)

  8. paulstelzer commented on Dec 17, 2018

    @paulstelzer
    Contributor

    @hghammoud This was just an idea for a workaround ;) You problem is already fixed by #16770 - so just wait for the next beta or fork the repo and create the newest version yourself :)

  9. davidecheli commented on Dec 17, 2018

    @davidecheli
    Author

    Thanks for developing the solution so fast. I will comment the select() method 'till next beta.

  10. ionitron-bot commented on Jan 16, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  11. locked and limited conversation to collaborators on Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions