How to use angular2 with spring boot

I would like to develop an application with angular2 as front end and spring boot as the back. According to my knowledge, there are two ways to achieve this 1) Create an angular2 application, and the rest of the calls will contact the spring boot application. 2) The presence of angular2 files in the spring boot maven application resource folder as part of the user interface.

This is the best way.

Thanks in advance.

+7
spring-boot maven angular
source share
1 answer

The best tutorial I found that installs Angular 2 with spring boot is thie Angular2 and spring Download

In this tutorial, he uses maven modules. One for spring backend and one for angular2 interface.

So, to go to option 2, you can simply use Angular cli in the tutorial and point it to the resource folder (preferably the one you are creating ... i.e. ui resources or something else), then configure this 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 this helps!

+3
source share

All Articles