The NgModelController has two extremely useful properties, $parsers and $formatters. $parsers is an array of functions that sanitize/convert values taken from the DOM. $formatters is an array of functions that format/convert model values before they are displayed in the UI.

##$parsers in action

Recently created a directive that uses $parsers to validate the DOM value against the specified regex. If it doesn’t match the regex is simply returns an empty string.