I’m trying to access a tab to change its label in my project. The IonTabs documentation indicates there is a getTab method; however, it doesn’t look like it exists. I see the other expected methods but not getTab.
Is this a React-specific question? If so, maybe move it to the React subcategory, so people concentrating on that framework will be more likely to see it and help you.
IonTabs is part of @ionic/angular and documented here https://ionicframework.com/docs/api/tabs#methods; however, if you think I should move it, that’s fine.
I was just asking for confirmation, because I didn’t want to give you an Angular-specific answer to a React question. If you are using Angular, then I think a considerably more idiomatic approach would be to use interpolation and/or property binding to bind the label you want to be flexible, something like:
…then you simply assign to
foo in the controller, and carry on merrily unconcerned about the existence of
getTab (or lack thereof).
My problem is that I need to update the label from a different component, a page. The api documentation indicates there is a getTab method that would give me the access to the tab I need. Then I could create a method in the tab that would update an instance variable that I could then use your technique. Unfortunately, the api documentation is incorrect as I just learned here:
It’s an open issue.
Can you elaborate some more, preferably with a concrete example of what the tab does, how the page that is changing its label relates to said tab, what the options are for the tab label, and an overview of the app’s purpose?
What you describe worries me greatly, but I don’t want to just whale on you without having a better understanding of how to make constructive suggestions.