Quantcast
Channel: How to add styles based on condition - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Mohamed Farouk for How to add styles based on condition

By using [ngClass]. I am not a big fan of inline styles//CSS.myClass{overflow:scroll;height:483px}//Componentexport class MyComponent { public ShowHideSection : boolean = true;}//HTML<div...

View Article



How to add styles based on condition

I am trying to add css to my div based on my input checkbox<div class="pvreveal" [style]="ShowHideSection ? 'overflow:scroll;height:483px':''"><input id="isDelivery" type="checkbox"...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images