Angular JS - Automatically focus input and show typeahead dropdown - ui.bootstrap.typeahead

后端 未结 11 1526
孤街浪徒
孤街浪徒 2020-11-30 03:07

I am using Angular JS - ui.bootstrap.typeahead:

I would like to click a button and focus an input field and automatically show the typeahead suggestion dropdown. I h

11条回答
  •  北海茫月
    2020-11-30 03:49

    you can achieve by this code

     $scope.change = function() {
            var e = document.getElementById("test");
            var $e = angular.element(e);
            $e.triggerHandler('focus');
            $e.triggerHandler('input');
        }
    

    change the test to your type-head ID

提交回复
热议问题