I have a component that I am exporting with 2 variables and 2 functions to toggle those variables (which are booleans).
However, when I trigger my function using (click), I encounter the following error:
ERROR: ReferenceError: 'landing' is not defined.
If I define 'landing' and 'portfolio' as variables using var landing = true;
, I cannot evaluate them with *ngIf
.
Here is the code snippet for my exported component:
export class NavigationComponent {
landing = false;
portfolio = true;
changeMiniNavLanding = function() {
landing = true;
portfolio = false;
}
changeMiniNavPortfolio = function() {
landing = false;
portfolio = true;
}
}
As someone new to TypeScript and Angular2, I'm unsure of what mistake I may be making. In Angular1, I would simply access them via $scope.