相关疑难解决方法(0)

如何以编程方式告诉HTML SELECT下拉(例如,由于鼠标悬停)?

如何以编程方式告诉HTML select下拉(例如,由于鼠标悬停)?

html javascript

95
推荐指数
7
解决办法
8万
查看次数

从 ts (angular, ng-select) 打开选择

我在一个页面上有几个 ng-select,我试图从 ts 打开一个。

我可以使用以下方法专注于正确的 ng-select:

@ViewChildren(NgSelectComponent) ngselect: QueryList<NgSelectComponent>;
this.ngselect.last.filterInput.nativeElement.focus()
Run Code Online (Sandbox Code Playgroud)

但是,我无法打开。我尝试了以下

this.ngselect.last.filterInput.nativeElement.open() 
Run Code Online (Sandbox Code Playgroud)

但得到错误:

_this.ngselect.last.filterInput.nativeElement.open is not a function
Run Code Online (Sandbox Code Playgroud)

.open() 是一种方法……我怎样才能让它工作? https://github.com/ng-select/ng-select#methods

angular-ngselect angular

5
推荐指数
1
解决办法
3761
查看次数

标签 统计

angular ×1

angular-ngselect ×1

html ×1

javascript ×1