Angularjs 有没有办法向angular TypeAhead指令添加自定义按钮?

Angularjs 有没有办法向angular TypeAhead指令添加自定义按钮?,angularjs,typeahead.js,typeahead,bootstrap-typeahead,Angularjs,Typeahead.js,Typeahead,Bootstrap Typeahead,我目前正在使用一个typeahead输入指令组件,该组件工作正常,但缺乏一定的功能。该组件通过一个查询获取所需的所有数据,该查询在加载页面并选择预定义的默认条目时立即启动。但是,总有至少>15个条目可用,但为了在同一下拉列表中创建新记录,我想在搜索列表的末尾添加一个“创建按钮”。因此,如果用户键入任何字符串,并且该字符串在下拉列表中不可用,则他/她可以通过该按钮创建记录。有没有办法创建自定义版本的typescript,在这里我可以添加一个按钮来保存在文本框中输入的记录 <h4>Cus

我目前正在使用一个typeahead输入指令组件,该组件工作正常,但缺乏一定的功能。该组件通过一个查询获取所需的所有数据,该查询在加载页面并选择预定义的默认条目时立即启动。但是,总有至少>15个条目可用,但为了在同一下拉列表中创建新记录,我想在搜索列表的末尾添加一个“创建按钮”。因此,如果用户键入任何字符串,并且该字符串在下拉列表中不可用,则他/她可以通过该按钮创建记录。有没有办法创建自定义版本的typescript,在这里我可以添加一个按钮来保存在文本框中输入的记录

<h4>Custom popup templates for typeahead's dropdown</h4>
<pre>Model: {{customPopupSelected | json}}</pre>
<input type="text" ng-model="customPopupSelected" placeholder="Custom popup template" uib-typeahead="state as state.name for state in statesWithFlags | filter:{name:$viewValue}" typeahead-popup-template-url="customPopupTemplate.html" class="form-control">


<script type="text/ng-template" id="customPopupTemplate.html">
<div class="custom-popup-wrapper"
 ng-style="{top: position().top+'px', left: position().left+'px'}"
 style="display: block;"
 ng-show="isOpen() && !moveInProgress"
 aria-hidden="{{!isOpen()}}">
<p class="message">select location from drop down.</p>

<ul class="dropdown-menu" role="listbox">
  <li class="uib-typeahead-match" ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }"
    ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{::match.id}}">
    <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>
  </li>
</ul>
用于typeahead下拉列表的自定义弹出模板
模型:{customPopupSelected | json}

从下拉列表中选择位置