7

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.

1 Answer 1

4

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.