updated 3.0 - refactored to use angularjs directive for submit control