I have a component with a stylesheet that loads correctly like this:
@Component({
selector: \'open-account\',
styleUrls: [\'open-account.component.scss\'
import { Component, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/platform-browser';
@Component({
})
export class SomeComponent {
constructor (@Inject(DOCUMENT) private document) { }
LightTheme() {
this.document.getElementById('theme').setAttribute('href', 'light-theme.css');
DarkTheme() {
this.document.getElementById('theme').setAttribute('href', 'dark-theme.css');
}
}