I am trying to use AngularJS $anchorScroll with $location.hash . However, when I set the hash, AngularJS adds a slash / after it.
For example, URL: http://localhost:13060/Dashboard . When I don't turn on the AngularJS library, I can click the link, #contact and go to http://localhost:13060/Dashboard#contact .
But when I turn on AngularJS and click on the link, it goes to http://localhost:13060/Dashboard#/contact , preventing $ anchorScroll from working.
Edit $ anchorScroll not working
Starting URL is http://localhost:13060/Category . When I add a category, it should go to http://localhost:13060/Category#/#id (where id is the new identifier) ββand scroll down to it. The url updates correctly, but $ anchorScroll does not scroll.
//jump to new category $location.path(""); $location.hash(cat.ID); $anchorScroll();
angularjs hashtag anchor-scroll
jth_92
source share