This is a recipe for using Spring Boot with Angular 2 as described here
spring init --dependencies=web spring-boot-angular2-static-sample
cd spring-boot-angular2-static-sample
ng init
Edit angular-cli.json and modify outDir to src/main/resources/static/
That is it, build angular 2 content:
ng build
Start up UI:
mvn spring-boot:run
Proxy the backend by creating a proxy.conf.json file with entries:
{
"/api": {
"target": "http://localhost:8080",
"secure": false
}
}
and start up UI part of the app using:
ng serve --proxy-config proxy.conf.json