Angular Material: md-autocomplete - how to hide md-autocomplete-suggestions on Enter event?

后端 未结 5 1982
旧时难觅i
旧时难觅i 2021-02-13 04:48

I have md-autocomplete:



        
5条回答
  •  面向向阳花
    2021-02-13 05:38

    The better way to access the controller methods is to target the element and then use the jqLite object to gain access to the controller:

    var $acElement = angular.element(document.getElementById('Auto'));
    var acCtrl = $acElement.controller('mdAutocomplete');
    acCtrl.hidden = true;
    

    Whenever you access anything using the scope() method on an angular element, your implementation will break if you ever want to disable angular debug info.

提交回复
热议问题