What is the right way to define links to angular routes in hashbang (non-HTML5) mode?
Suppose that I have the following nav. bar:
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#!/first">First</a></li>
<li><a href="#!/second">Second</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#!/" ng-click="logout()">Logout</a></li>
</ul>
</div>
It works but I have the following questions in mind:
- I saw a lot of articles where authors do the same thing via
/firstor#/firstinstead of#!/firstbut it doesn't work for me for some reason (I guess that's because I'm using#!as a hashstring but I don't know why there's so many examples with#/firstinstead of#!/firstif the latter is the default one) Is it ok to define
logoutaction this way?<li><a href="#!/" ng-click="logout()">Logout</a></li>
Because it seems a little bit ugly for me.