I'm trying to change button's style by clicking other button in a different component.
Right now, I have a main html page and there's an angular component loaded on page using angular selector <component1></component1>
Here's main html file containing the component:
<button id="button01"
tappable>
<ion-icon name="square" [ngClass]="Btn1"></ion-icon>
</button>
<button id="button02"
tappable>
<ion-icon name="square" [ngClass]="Btn2"></ion-icon>
</button>
and here's my component HTML file. It has a button that is trying to change that Btn1 and Btn2 style to button-active3 class.
<button id="componentbutton" tappable (click)="Btn1='button-active3';
Btn2='button-inactive';">Change Color!</button>
button-active3 and button-inactive are styles classes of button in my SCSS file.
I found this configuration doesn't trigger component's button to change styles of buttons in the main html file.
How can I make this work?
If I put that component's button inside the main HTML file, it will work fine.. but I think it doesn't work because now the button is in a component and the component can't access to ngClass of main HTML file.
Please help. If there's a way to work around it, let me know.
Thanks in advance.