My HTML looks like this:
<span ui-sref="{{detailsArt(art.Id)}}" check-val></span>
Within my directive check-val, I have the following code:
link: function(scp, el, attr) {
el.bind('click', function(event) {
//some logic with if:
event.preventDefault();
});
}
However, it seems that this is not working with ui-sref.
Interestingly, when I use
$state.go('detailsArt', {artId: art.Id})
, the directive works as expected.
I am wondering if it is possible to make ui-sref work with a directive click handler. If so, how can I achieve this?