Base Href and Angular Routing and Views

后端 未结 1 522
暖寄归人
暖寄归人 2021-01-22 06:01

I\'m developing a web application which defines the in the header as explained in this article.

The default URL that is mappe

相关标签:
1条回答
  • 2021-01-22 06:17

    Removing the slash from the views

    app.config(["$routeProvider", function ($routeProvider) {
        $routeProvider.when('/login', {
            templateUrl: 'views/login.html',
           controller: 'LoginCtrl'
        });
    }]);
    

    and making links like:

     <a href="login">Login</a>
    

    but leaving the slash for the route resolved the problem.

    0 讨论(0)
提交回复
热议问题