I would like to develop an application with angular2 as front end and spring boot as back end. As per my knowledge there are two ways to achive this 1) Create an angular2 app and using rest calls communicate with spring boot application. 2)Having angular2 files in resource folder of spring boot maven application as UI part.
Which is the best way.
Thanks in advance.
The best tutorial I've found that sets up Angular 2 with spring boot is thie Angular2 and Spring Boot
For this tutorial, he utilizes maven modules. One for the spring boot backend, and one for the angular2 front end.
So, to go with option 2, you can just use the angular cli in the tutorial and point it to a resource folder (preferably one you create... i.e. ui-resources or something) then set up that as a resource in your maven pom.xml. i.e.
<resource>
<directory>src/main/ui-resources</directory>
<excludes>
<exclude>node_modules/**</exclude>
</excludes>
</resource>
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With