User Interaction Events

You have already been exposed to user interaction events. These include mouse and keyboard events, as well as other events such as the focus and blur events. There are typically two places where you will implement interactions for user events. One is using the ng event directives, such as ng-click, and simple interactions in the view and controller code. The second place to add user event interactions is in the link function of custom directives.

You have already been exposed to both of these methods in previous chapters; what I wanted to point out here is that you do have a choice of which one you want to use. The advantage of using the built-in ng event directives such as ngClick is that you do not have to add the complexity ...

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.