I am using the latest version of angualar 5.0 in the new project. And i am new to this framework and would appreciate some help from the angular developers.
I would like to set the styleUrls property with class level variable at the runtime dynamically. In my case, the styleURL path will be coming from the database via the angular service.
import { Component } from '@angular/core';
import { Title } from '@angular/platform-browser';
@Component({
templateUrl: './search.component.html',
styleUrls: ['./search.component.css']
})
export class SearchComponent {
pageName = 'New Search Page';
PropfavMovie = 'Gladiator';
constructor(private _titleSrv: Title) {
this._titleSrv.setTitle('Search page');
}
Is there a way i can set the Component's styleUrls property in the ngOnInit event or from the constructor of SearchComponent class.
In my case, every client has its own stylesheet. So that's i need to pull the stylesheet path from the db and populate the @components property dynamically.