0
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 -20
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 -21
public 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 this using function (click)="div = 0; funcao()" ou (click)="funcao()" funcao(){ this.div = !this.div; }
Browser other questions tagged angular typescript javascript-events angular2-directives
You are not signed in. Login or sign up in order to post.
Good friend... it worked. Thank you very much.
– Dan100
Be aware that the div is not hidden but removed from the gift
– Eduardo Vargas
yes, Eduardo was no longer viable to remove the gift, because he will reuse it
– Willian