Hello fellow programmer,
im getting used to Angular 2, therefore Typescript, so have mercy with me.
I have 5 Buttons which should enable or Disable Content on Click, like a Sidemenu.
HTML - Code
<li class="navigation-items">
<button class="dropdown-header" (click)="onSelect(2)">Link 2</button>
<div *ngIf="DropdownVar == 2" class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</li>
Typescript - Code
DropdownVar = 0;
onSelect(x){
this.DropdownVar = x;
console.log(x);
}
It seems that my var gets the propper value but my *ngif
does not work.
Is there a better way to handle my Problem?
Additional i would like to have a little animation for the Content which i want to show, but i guess css is the way to go.