Angular: Bad Practices
Armen Vardanyan
4525

Hi Armen, I really appreciate your articles and find them very helpful!

However, I have some trouble understanding how to apply the data manipulation part in my case. Maybe you can enlight me about what the best practice would be.

In my case the server sends a User object (UserFromServer) that would be use everywhere in my app except in the form (UserInForm) where the user should be transformed:

As you can see the form object doesn’t have the same fields as the user object and I find it disturbing to have to different interface representing the same thing domain wise.

So should I have one User interface and class with all possible fields (see User interface in Gist) and multiple contructor one to transform the UserFromServer to the UserInForm and the inverse, or should I have multiple interface and class?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.