Added a custom directive for validation.
Made changes to the validation directive and added a validation example to the main view.