Recently, I started learning Angular and came across a challenge that I need help with. Here is the scenario:
<button *ngIf="entryControlEnabled && !gateOpen" class="bottomButton red" (click)="openGate()">Open</button>
<button *ngIf="entryControlEnabled && gateOpen" class="bottomButton green" (click)="closeGate()">Close</button>
In my .ts file, I have the following logic:
if (data.IoNumber == config.IoNumberGates) {
if (data.IoStatus == "DetectorDeactivated") {
this.gateOpen = true;
} else {
this.gateOpen = false;
}
}
I am looking to update
data.IoStatus == "DetectorDeactivated"
to data.IoStatus == "DetectorActivated"
To better explain, here are my methods:
openGate(){
this.data.IoStatus == "DetectorActivated"
}
closeGate(){
this.data.IoStatus == "DetectorDeactivated"
}
If anyone can assist me with this issue, I would greatly appreciate it.