How To Pass Value From Typescript Code To Css In Angular 6 December 27, 2023 Post a Comment I know I've to use ngClass or ngStyle but I'm not able to figure out how to pass that value. Here is my code. strip.component.ts import { ... } from '@angular/core'; @Component({Solution 1: Use class<div [class]="'col-'+ widthValue"></div>CopyORUse style.width<div [style.width]="(widthValue/12)*100 + '%'"></div>CopyDEMO Share Post a Comment for "How To Pass Value From Typescript Code To Css In Angular 6"
Post a Comment for "How To Pass Value From Typescript Code To Css In Angular 6"