Here is a snippet of the code from my component:
export class RootComponent {
isActive = true;
setVal(j) {
if (j == 0) {
isActive = false;
}
}
}
I am new to Angular and I have a question that might seem basic. Why am I unable to access or modify the isActive
field within the same class method, such as setVal
?