I needed a directive to enable focus in an input text element when some variable was set to true. The case was that the user would open up an accordion and the input element would appear. The mouse had to be placed inside the input element on show.
I found the following blog-article describing how to do this. It works just like a charm: http://www.angulartutorial.net/2014/04/angular-js-auto-focus-for-input-box.html