0

I"m running into an issue when I click on a quicknav, the anchor tag replaces my search parameters in the URL.

'example.com/search?hash=1234' becomes 'example.com/search#FAQ'

instead of 'example.com/search?hash=1234#FAQ'

How do I fix this? Version 1.1.5

HTML anchor tags:

<a href="#{{page.id}}" ng-repeat="page in results.page">{{page.id}}</a>

I do have HTML5 mode enabled if that makes a difference:

.config(['$locationProvider', function($locationProvider){
    $locationProvider.html5Mode(true).hashPrefix('!');
}]);
4

1 回答 1

0

我现在正在使用一些 hacky 解决方法:

<a ng-href="{{resultsHash}}#{{page.id}}" ng-repeat="page in results.page">{{page.id}}</a> 

和价值resultsHash

$scope.resultsHash = "?hash=" + data.hash;

因此,每次他们使用 quickNav 链接时,哈希都会包含在路径中。这不是一个理想的解决方案。但它模仿了我想要做的事情。

于 2013-08-22T15:18:25.270 回答