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
Add the following link to the
<!-- Ng Messages--> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular-messages.min.js"></script> <!-- Ng Messages-->...