S
S
semexion2021-05-26 08:42:14
Angular
semexion, 2021-05-26 08:42:14

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 question

Ask a Question

731 491 924 answers to any question