I have a requirement where there are many CSS files present on a CDN server and are publicly accessible.
My application built using Angular 17 needs to read a value from one of the query parameter and then hit that CDN server with CSS file URL to load the CSS file so that UI can be rendered according to the CSS file name provided in the application URL query parameter.
I have tried few options like loading CSS file using HttpClient
in component ngOnInit
, or using APP_INITIALIZER
approach. I am able to load CSS file but this CSS does not apply on html.
I have used the achieved the same thing in AngularJS using
<link ng-hre="https://<cdn-server-domain>/{{cssFileName}}.css">
but not able to find any working solution in Angular.
Please suggest.