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.

1 Answer 1

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.

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.