I've been migrating my projects from JQuery to Angular.js
I have several links that targeted to '#', for example in bootstrap dropdown:
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Administrator <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="info.html">Info</a></li>
<li><a href="settings.html">Settings</a></li>
<li class="divider"></li>
<li>
<a id="logout" href="logout.html">
<span class="glyphicon glyphicon-off"></span> Logout
</a>
</li>
</ul>
I try to implement page routing with angular routeProvider
$routeProvider.when('/content/chat', {
templateUrl: config.indexURL + 'content/chat',
controller: 'ChatCtrl'
})
.otherwise({ redirectTo: '/' });;
The page keep changing when the link targeted to '#' meanwhile I want to keep them not redirected
I've got a solution that we can changes the href attribute to javascript:void(0);
href="#" causes location address to change, can we avoid it?
but there are so many links that targeted to # in my pages (many of them generated by JQuery plugins) and I don't want to change it one by one.
Is there any way to prevent page changing when the link href='#'
in routeProvider settings?