【发布时间】:2017-03-09 06:58:01
【问题描述】:
我在控制器中有范围值。我需要在自定义类型提前模板中显示范围值。
但是自定义模板不会访问它总是显示为空的控制器值。
在我的场景中,我需要在自定义模板中显示“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>
演示:
【问题讨论】:
标签: angularjs bootstrap-typeahead twitter-typeahead angular-ui-typeahead