0

I am trying to create a simple Spring boot web application. i am using Thymeleaf and AngularJs for my front end.

everything works fine until I try to add ui.router in my application.

below is my project structure

below is my app.config:

.config(function($stateProvider, $urlRouterProvider) {
             $urlRouterProvider.otherwise('/home');

                $stateProvider        

                    .state('home', {
                        url: '/home',
                        template: index1.html
                    })
})

when i run my application, the partil "index1.html" is not loaded in ui-view.

i am getting error as "http://localhost:8080/index.html is bad request"

from my understanding the templateUrl is worng. please guide me in getting this right.

Milan
  • 1,780
  • 1
  • 16
  • 29

1 Answers1

0

If you want to let Angular UI router do the routing, you need to create a Spring Controller that accepts the route, but returns index.html.

Perhaps this answer can help also: Which spring view resolver plays nice with angularjs?

Also article can help.

Community
  • 1
  • 1
Milan
  • 1,780
  • 1
  • 16
  • 29