Why tab-button id keep changing?


#1

Hi,
I want to change style of specific tab-button in the ion-tab tag
So when i inspect the code, i found this with id id="tab-t0-1"

<a class=“tab-button has-icon icon-only disable-hover” href="#" role=“tab” ng-reflect-tab="[object Object]" id=“tab-t0-1” aria-controls=“tabpanel-t0-1” aria-selected=“false”>

Then I managed to change the style using the id. But the problem is every time i navigate back to TabsPage from side menu link or back button, i notice that that id will keep changing,so the style no longer work.


#2

Don’t do this. Use CSS classes and/or direct binding to [style.whatever] properties instead of fooling around with the DOM manually. That’s Angular’s job.