We're trying to come up to speed with Angular.js and our lead JS dev has requested that when we mock up links that don't yet have a page to go to, we should do the following:
<a href="javascript://">
instead of this:
<a href="#">
His reasoning was that Angular already has a use for the hash tag because it means something to Angular and if it doesn't find the router/directive then it is redirected to /scenario.
What is a better way to do this?
According to the AngularJS docs for the A directive, you should be using href=""
.
The reasoning for this is to allow easy creation of action links with ngClick directive without changing the location or causing page reloads, e.g.:
<a href="" ng-click="model.$save()">Save</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With