Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ngclass click change toggle

<div [ngClass]="{'small-screen': isMobile, 'large-screen': !isMobile}></div>

<a
[style.border] ="change ? 'white 1px solid': 'blue 1px solid'"
[style.background-color]="change ? 'blue' : 'white'"
[style.color]="change ? '#fff' : 'blue'"
[style.font-size.em]="change ? 'l' : '0.7'" (click) ="change = !change" href="#">
Download
</a>

TS
change = true
 
PREVIOUS NEXT
Tagged: #ngclass #click #change #toggle
ADD COMMENT
Topic
Name
6+6 =