David Limkys
David Limkys

Reputation: 5133

Ui-router not routing by url

router change view by uri

my current router is

    $stateProvider
        .state('main', {
            url: "",
            views: {
                "header": { templateUrl: "partials/header.html"},
                "mainContent": { templateUrl: "partials/mainContent.html"},
                "footer": { templateUrl: "partials/footer.html"}
            }
        })
        .state('lesson', {
            url: "/1",
            views: {
                "header": { templateUrl: "partials/header.html"},
                "mainContent": { templateUrl: "partials/lesson.html"},
                "footer": { templateUrl: "partials/footer.html"}
            }
        })

when i go into localhost/

i see the main state

but when i go to localhost/1 i still get the main state.

What am i missing ?

Upvotes: 1

Views: 157

Answers (1)

David Limkys
David Limkys

Reputation: 5133

Found a solution, applying html5 mode fixes this.

$locationProvider.html5Mode(true); 

Upvotes: 1

Related Questions