javascript - Angular focus on input using ng-click -


this question has answer here:

i attempting make input focused on when user clicks on element.

i have following angular bootstrap modal pop following content:

<div ng-hide="thedata.input">     <div ng-click="showtheinput()">click me</div> </div>  <div ng-show="thedata.input">     <input id="focus_me" type="text" required />    </div> 

here controller code reason, can't input focus.

$scope.thedata = { input: false }  $scope.showtheinput = function() {     $scope.thedata.input = true;     $("#focus_me").focus(); } 

could me out? know using jquery doesn't work. or guidance appreciated.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -