Search code examples
angularionic-frameworktabsviewchild

Problems with @ViewChild


I am currently creating a @viewChild component, tabs in my app. However, upon inserting the following lines:

@ViewChild('tabs') tabs: IonTabs; 

I am facing an error 'Expected 2 arguments, but got 1.'

Please helps. Thks!


Solution

  • Just found the error.

    Insert the new line below:

    @ViewChild('tabs', {static: true}) tabs: IonTabs;
    

    Hopes this helps anyone !