Angular version : latest --1.2
I am loading views into ng-view
based on $routeprovider
, I am in the middle of developing an application, so right now I am just giving the URL in the browser and its corresponding VIEW is loaded.
Problem is I have links in partial pages, which should scroll me to particular div and the links are generated using ng-repeat
.
Code:
<li ng-repeat = "(key,val) in test.Questions">
<a href="#{{key}}" >{{ $index+1}}</a>
</li>
So when I click on the above generated links, the URL is replaced with link.
Eaxmple:
http://localhost:8085/Questionarie/#/exam/533135
is the URL to load VIEW, but its replaced like this:
http://localhost:8085/Questionarie/#QS7.....
instead I want something like this
http://localhost:8085/Questionarie/#/exam/533135#QS7
NOTE: I tried using $anchorscroll
, but its working only if I give string literal in scrollTO('foo')...
, if I give like scrollTo({{foo}})..
its not working
Right now I am not using any back end, just developing the UI in localhost. I saw some info on HTML5 mode, but could not understand how to use.
Also I am planning to use NodeJS
and express in future.
CONCLUSION So the problem is inner page links conflicting with angularJS routing, not only the case I mentioned above, but while using Twitter Bootstrap tabs also the URL is replaced.