F
F
FlatUser2020-05-21 01:18:33
Angular
FlatUser, 2020-05-21 01:18:33

How to make a service for managing css classes in Angular?

I'm a noob in Angular and I can't solve the problem, I have no idea even.
I have many components TextInput, SubmitButton, List etc.
Each has its own set of css classes that change their appearance, for example, in TextInput it is fillded, empy, not-active.
I need to change the TextInput class from SubmitButton.
How? Is there any example? I did not find an implementation of this through services, and is it correct to do this at all?
help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
the5x, 2020-05-22
@the5x

Without an example, it is not particularly clear what you need. As I understand it, you need to manage child elements from the parent component. To do this, you can use .parent .child { ... } in CSS. They can be written in global css if you don't want to repeat the same code in the same components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question