Answer the question
In order to leave comments, you need to log in
How to change styles in Angular 2?
Good day! When a component is declared (for example):
@Component({
selector: 'quest-summary',
template: `
{{ someName }}
`,
styleUrls: ['./quest-summary.component.css']
})
Answer the question
In order to leave comments, you need to log in
You can't do that. If you want the appearance to change depending on some user settings, this is done (as a practical option):
in the layout component, which "wraps" all other components, write a substitution class that will change depending on the user's choice. And in styles, write the main styles for all +, depending on the selected class, that is:
.selected-class-2 h1 {
color: red;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question