Spring Boot/Angular app. routing a completely self contained HTML file

时间:2017-12-18 07:59:37

标签: angularjs spring spring-mvc

This might seem strange but I basically want to create a HTML file that is not in anyway associated to the angular/spring boot app.

Currently:

  • 'localhost:8080/' --- (redirects to angular app at '/#!/login')

What I want:

  • 'localhost:8080/angular' --- (redirects to angular app at '/#!/login')

  • 'localhost:8080/' --- (shows me a normal self contained HTML file e.g.'test.html')

I am very new to angular and Spring so even just guiding me in the right direction would be a huge help.

Thanks.

1 个答案:

答案 0 :(得分:1)

You should use ngRoute.By the courtesy of "ngRoute" you can redirect user to specific views by the specific urls. Pls make some research about it. Let's assume you solve your view and redirect issues. How you gonna fetch data from server side? At this time I suggest you to look at service and factory objects. Hope it helps.

Sample code :

0