我用角UI路由器,就像如何在HTML中使用使用錨與UI路由器
.state('home', {
url: '/home',
templateUrl: 'view/home/home.html',
controller: 'homeCtrl'
})
.state('guide', {
url: '/guide',
templateUrl: 'view/guide/guide.html',
controller: 'guideCtrl'
})
,我可以在瀏覽器的URL訪問,http://localhost:8000/dist/#/home 但是,我不能用一個錨我HTML 如果在一個home.html的錨這樣
<a href="#aaa">scroll to aaa</a>
....
<h1 id="aaa">AAA</h1>
當我點擊「滾動到AAA」,將URL http://localhost:8000/dist/#/aaa 並返回home.html的空白PAGE電泳錨不起作用。
我該如何解決這個問題?
你想要發生什麼?重定向到外部網站?或者在你的應用程序中的默認路線? – henrikmerlander