i'm trying set anchor tags template, gets modified angular route
and has following url scheme:
main.html#/view/:name
i tried ignore angular's routing setting target
attribute:
<a target="_self" href="#some_anchor">go anchor</a>
however, actual link main.html#/some_anchor
, , omitting target=_self
doesn't change anything.
tried change links target actual current url
$location.path() + "/#some_anchor"
which doesn't work either (no matter if set target
attribute or not), still "page not found" error.
i have make workaround in same situation:
define function in scope:
$scope.scrollto = function (id) { var old = $location.hash(); $location.hash(id); $anchorscroll(); $location.hash(old); };
and call way:
<a href="" data-ng-click="scrollto('anchor')">scroll anchor</a>
Comments
Post a Comment