Custom Form Validation in AngularJS
Write validation directives that call ctrl.$setValidity.
Write validation directives that call ctrl.$setValidity.
Read form/control state flags to drive UX and disable submit.
Map REST resources to factories that wrap $http calls.
Inject collaborators by name; protect minification with array syntax or $inject.
Configure when/otherwise routes with $routeProvider in a config block.