0
我在controller中有范围值。我需要在自定义类型提前模板中显示范围值。如何访问自定义typeahead模板中的控制器值
但自定义模板将不会访问控制器值,它总是显示为空。
在我的情况下,我需要在自定义模板中显示“scope.names”。但它显示为空。
如何在自定义模板中显示控制器值。
HTML:
<div class='container-fluid typeahead-demo' ng-controller="TypeaheadCtrl">
<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">
</div>
DEMO:
https://plnkr.co/edit/HEf0lipdBP5ZyuciQsDo?p=preview
我需要在下面的“选择位置从下拉”在下面自定义列表从控制器 – CodeMan
显示“$ scope.states” 和$ scope.names @CodeMan让我明白正确。你想要显示两个列表的项目作为一个下拉的值?因此,无论我们在输入中输入什么,都会得到两个列表的建议。那是对的吗? – tanmay
是的,我想显示两个下拉列表 – CodeMan