Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

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){
        /* call the service/api to get the css variable values in cssVariables */

    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #css #dynamically #angular
ADD COMMENT
Topic
Name
2+8 =