I have 2 DIVs and would like to manipulate them with buttons. I have 2 DIVs. When one appears the other is hidden, vice versa. Can someone help me ? my version of Angular is 5.
Function1 Function2
content -2I have 2 DIVs and would like to manipulate them with buttons. I have 2 DIVs. When one appears the other is hidden, vice versa. Can someone help me ? my version of Angular is 5.
Function1 Function2
content -2public div: boolean = true;
<a (click)="div = 1">div1 show</a>
<div *ngIf="div">
div 1
</div>
<br>
<a (click)="div = 0">div2 show</a>
<div *ngIf="!div">
div 2
</div>
You can use this function (click)="div = 0; funcao()" ou (click)="funcao()" funcao(){ this.div = !this.div; }