how to apply inline style in angular for element using js code example
Example 1: add css dynamically in angular 6
import { CssService} from './Css.service';
@Component({
selector: 'DynamicCss',
templateUrl: './DynamicCss.component.html',
styleUrls: ['./DynamicCss.component.scss']
})
export class ServiceProviderComponent implements OnInit {
cssVariables: any;
constructor(private cssService:CssService){
}
}
Example 2: add css dynamically in angular 6
ngOnInit(){
this.appendCss(this.customizeFormData);
}