Answer the question
In order to leave comments, you need to log in
Is it possible to use classes in Angular to type data?
To unify and comply with the DRY principle, I use a single component that, as an input parameter (@Input), takes a value in the form of a class, empty during initialization or filled with values when loaded via the API (I use class-transformer).
This is necessary in order to use the URL api for CRUD of this type in the service based on the class of the current value in the component.
Does this approach exist? Or using classes as data models should not solve this problem.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question