If you want to know how you can conditionally require form inputs with AngularJS? There’s no need to write a custom directive. Angular’s documentation is good but not complete. In fact, there is a directive called ngRequired, that takes an Angular expression.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.