Continuing within the context of the previous examples, we will now create a custom directive to validate some form fields. This recipe applies to any type of form field; however, we will use the
AngularJS offers some very useful resources for form validation with built-in directives. We will create a component that can be reused elsewhere in our application.
Just as we did in the previous chapters, we will continue using the same application created in the previous recipe.
In this example, we will use an external library called
For the purpose of this example, we just add the library as a dependency in our
index.html, using a
Content Delivery Network (CDN), as ...