Search code examples
javascriptangularjsangularjs-directiveangular-ng-if

being notified when ng-if is adding/removing element


I use ng-if to add/remove a typehead input for inline edition purpose. the ng-if value is updated by a "edit" button

So, what is the best or recommended way to give focus to the text input, once it's added to the dom ?

thanks

Lionel


Solution

  • The current version of AngularJS doesn't have a focus directive.

    But you can refer Input autofocus attribute

    And create you own directive for this usage.