search

Home  >  Q&A  >  body text

angular.js - How to append the status to the secondary path by removing # in Angularjs?

I now have a URL like this: http://172.25.186.1/wxHome/www/#/tabs/index
After setting $locationProvider.html5Mode(true);, in theory the URL should become like this: http://172.25.186.1/wxHome/www/tabs/index
But the actual situation is this: http://172.25.186.1/tabs/index

The routing configuration is as follows:

 $stateProvider.
        state('kjk', {//框架页
            url: "/",
            controller: "KJK.rootController",
            templateUrl: baseUrl+"views/templates/kjk_Main.html"
        }).
        state('kjk.tabs', {//tabs框架页
            url: "tabs",
            controller: "KJK.tabsController",
            templateUrl: baseUrl+"views/templates/kjk_Tabs.html"
        }).
        state('kjk.tabs.index', {//首页
            url: "/index",
            views: {
                'index_tabs': {
                    controller: "KJK.index.indexController",
                    templateUrl: baseUrl+"views/kjk_index.html"
                }
            }
        })

HTML

<base href="/" />

How can I add routing information to my http://172.25.186.1/wxHome/www/之后?

曾经蜡笔没有小新曾经蜡笔没有小新2794 days ago1074

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-15 16:55:39

    Change the content of base to:

    <base href="/wxHome/www/" />
    

    That’s it.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-15 16:55:39

    You can consider adding a base tag to the page

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-15 16:55:39

    Is the problem solved?

    reply
    0
  • Cancelreply