O'Reilly logo

AngularJS by Example by Chandermani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a remote validation clues directive

The workout name's remote validation works well now, but the user does not realize that the workout name is being validated remotely, and may be surprised when all of a sudden a validation message appears.

We can improve the overall user experience if we can show a busy/progress indicator every time remote validation happens. Let's build a busy-indicator directive. We plan to build three versions of the same validator with a slightly different approach and work our way through some new concepts in directive building.

Here is what the first version busy-indicator implementation looks like:

angular.module('app').directive('busyIndicator', ['$compile', function ($compile) { return { scope: true, link: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required