+ 1

Angular or thymeleaf with Spring in backend

What is the advantage of using angular in front end instead of thymeleaf. Can I do the same thing with thymeleaf as I do with angular?

5th May 2022, 2:00 PM
Diogo
Diogo - avatar
2 odpowiedzi
+ 5
The main difference is the dynamic rendering. Thymeleaf is a template generator. HTML pages are generated by Spring on the backend server. All changes on the page need to call the backend, generate a new page and refresh the user's page. Imagine that the Facebook page refreshes every time you make a like or click on a post... Impossible also to make a chat... JavaScript frameworks like angular work in a way that the frontend and the backend are separated on two different servers. The backend becomes a Rest API, it will only send data to the frontend in relation to the http request sent by the client. The front end is download on the client's computer and it is the browser via JavaScript that will modify the HTML page: this will allow to create a dynamic application, without refreshing the web page. This is called a single page application.
5th May 2022, 9:45 PM
Roland
Roland - avatar
0
Thank you Roland, the best explanation about the subject I had!
6th May 2022, 12:37 PM
Diogo
Diogo - avatar