Ionic 4 change color tab on clik


I have a parent component, let’s call it component A. Inside I have 10 tabs : T1 to T10
Inside child component T1, i have a button to save() my data.
I want also, change de color when it’s done to have the visual information of which tab is saved.

How can I do that ?

I try different things to learn, for exemple, in the parent component A ngOnInit() :

let tab1 = this.el.nativeElement.querySelector(“ion-tab-button”);
tab1.innerText = “T1 saved”;

  '2px dashed #FFE066'

it works fine.

Now i want to access “ion-tab-button” from my function save() in the child component T1
But i’m lost on how i can do that.

Thank you

not sure if the answer is here, but have a look at :

@trollanfer thank you, very good article of Josh,
i finally find a way :

in the child component ts :

tabT1: HTMLElement = document.querySelector('ion-tab-button');

 //store data 
    this.renderer.addClass(this.tabT1, 'tab-saved');

in the parent component scss : add style

/* The animation code */
@keyframes example {
    from {background-color: rgb(95, 173, 136);}
    to {background-color: #FFE066;}

.tab-saved {
    background: #FFE066 !important;
    // color: white !important;
    animation-name: example;
    animation-duration: 4s;

this work like i would : when i save the tab , color change too (takes the color of the save button)