Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass models from API to components

What's the best way for transferring models between backend and frontend.

  • Is it better to clone the backend ones in frontend even if not all properties are used ?
  • Or use DTOs to transfer only necessary properties for each use-case ?

If there is a best practice, design-pattern or any other suggestion I'm interested to know.

For information my stack is Spring Boot and Angular 6.

like image 335
Ghassen Avatar asked Mar 11 '26 04:03

Ghassen


1 Answers

try to use swagger mate

https://dzone.com/articles/using-swagger-to-connect-a-backend-to-an-angular-f

hope this helps

like image 66
vikvincer Avatar answered Mar 12 '26 19:03

vikvincer