AngularJS ngFocus and ngBlur directives. From https://gist.github.com/eliotsykes/5394631