2

Is there angular style to listen to clicks on elements without using ng-click.

In JQuery we can do it this:

$("div").on("click",function);
$("div").click(function);

This helps in registering click dynamically.

What is the Angular way to do this?

1
  • 2
    I think you should not do that, you should keep the controller clean from UI dependency, take a look this post as reference Commented Aug 5, 2014 at 7:35

1 Answer 1

2

You can use jqLite:

angular.element(e).on('click', function($event) {...});
Sign up to request clarification or add additional context in comments.

Comments

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.