I am using $anchorScroll
to scroll to page top where the html element has ID #brand
.
<body>
<header id="brand">
<!--Content-->
</header>
</body>
AngularJS code:
$location.hash("brand");
$anchorScroll();
However, after $anchorScroll
runs, the page url becomes http://localhost:8080/##brand
, which means ##brand
is appended to the original url. How can I keep the original url when using $anchorScroll
? Thanks in advance!