1

I have such html:

<span ui-sref="{{detailsArt(art.Id)}}" check-val></span>

and in my directive check-val i have:

link: function(scp, el, attr) {
  el.bind('click', function(event) {
    //some logic with if:
    event.preventDefault();
  });
}

and it's not working with ui-sref(

when i'm using $state.go('detailsArt', {artId: art.Id}) this directive is working fine.

Is it possible to use ui-sref with directive click handler, and how?

1 Answer 1

1

Because it should be: ui-sref="detailsArt({artId : art.Id})" And of course you need an anchor tag a as said by Pankaj

<a ui-sref="detailsArt({artId: art.Id})" check-val></a>
Sign up to request clarification or add additional context in comments.

1 Comment

with ui-sref="detailsArt({artId : art.Id}) it works too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.