小编Dan*_*lor的帖子

在 ng-bootstrap 中禁用下拉菜单?

有没有办法禁用 ng-bootstrap 中的下拉菜单?我有我自己的自定义下拉表,我想用作下拉列表。

我想要这样的东西,它有预先输入自动填充但没有下拉菜单。

<p>This typeahead shows a hint when the input matches because the default values have been customized.</p>

<label for="typeahead-config">Search for a state:</label>
<input id="typeahead-config" type="text" class="form-control" [(ngModel)]="model" [ngbTypeahead]="search" />



import {Component} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {NgbTypeaheadConfig} from '@ng-bootstrap/ng-bootstrap';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/distinctUntilChanged';

const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado',
  'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia',
  'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', …
Run Code Online (Sandbox Code Playgroud)

ng-bootstrap

4
推荐指数
1
解决办法
4086
查看次数

标签 统计

ng-bootstrap ×1