Combining Angular2 and Spring Boot is a great way of getting up and running quickly with a new web application.
- excellent angular-cli tool
- spring-boot cli tool
-
first create a Spring Boot web project either by starting from http://start.spring.io or using the following CLI command $ spring init --dependencies=web <project.name>
-
now generate a Angular 2 project using the angular-cli $ ng init
-
change the location where angular-cli builds the artifacts, edit angular-cli.json and modify outDir location to /src/main/resources/static
-
now build the static content $ ng build
-
and start up the Spring-Boot app $ mvn spring-boot:run
-
And the Angular2 based UI should render cleanly! http://localhost:8080