4
I’m using a function called with ng-click
, via a link (Anchor).
However, because of the hash #
, the page is "skipping" every time I click on this link.
This is my code:
<a ng-click="openImageModal(request)" href="#">
Abrir modal
</a>
I’d like to make a preventDefault
on that link, so that it could perform the function of angularjs
, but without "skipping" the page, because of the hash #
.
How to do this in the AngularJS
?
I would like a solution without using jQuery, because I want to get rid of his dependency.
And the
.directive
?– Guilherme Nascimento
@Guilhermenascimento you say in class statement or directive definition?
– OnoSendai
I don’t understand Angular.js, but I believe it’s in the context of
angular.module
. I’ll try to do, though your answer without removing thehref="#"
already worked perfectly, less xD maintenance code (my +1 was already guaranteed).– Guilherme Nascimento