How can I simplify form validation in angularJS?