0

This is my html

  <div class="main" ng-controller="mainCtrl">
       <div " ng-show="showhide"><input type="text" class="textbox ></div>
       <div ng-click="showtext()">click</div>
  </div>

When i click on click ,i have to show textbox and that textbox should be clicked one so

This is my controller

  app.controller('mainCtrl',function($scope)
 {
      $scope.showtext=function($scope)
      {
          $scope.showhide=true;
          angular.element.find('.textbox').click();

      }
 });

but this is not working so How to do that in angularjs?

1
  • 1
    angularjs not proposal operating elements in controller.you can do this in custome directives. Commented Nov 15, 2013 at 8:03

1 Answer 1

1

you can simply do angular.element(".textbox").trigger("click");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.