I have a variable isLTEavailable
in my ts file inside a function. When the function is called, based on the a condition, isLTEavailable
's value changes and is logged correctly, but for some reason, it is not being updated in the DOM.
Here's my ngif condition:
<li class="nav-item dropdown" *ngIf="isLTEavailable">
Here's my ts function:
console.log("Lte --", lte_id)
if (lte_id != undefined) {
sessionStorage.setItem("lte_customer_id", lte_id.toString())
this.isLTEavailable = true;
console.log("isLTEavailable -----> ", this.isLTEavailable)
} else {
sessionStorage.setItem("lte_customer_id", 'n/a')
this.isLTEavailable = false;
console.log("isLTEavailable -----> ", this.isLTEavailable)
}
I printed the variable using string interpolation as well and it always shows true as its value even though console updates correctly.
P.S. isLTEavailable
is initialized as true.