Update data on ng-model on event triggers

Angular’s ng-model is famous for its 2 way binding. If there is an input box with an ng-model directive attached to it, angular invokes its digest cycle on each charachter we type, performing validations on the data (if any) and then updating the value on the scope if data is valid. Everything is so fast that it feels that data is validated real time. Sometimes we don’t need angular to update our model as we are typing. Sometimes, we need the user to fill out the complete form and once he performs a click on form submit, or presses enter or loses focus on the field, we want the user to be updated for invalid field entries. To accomplish such tasks, I came up with an up-gradation of the fpSubmit and fpModelUpdateOn directive. Continue reading