Angular directive to set and get caret position on input and textarea element