在下面的代码中,我使用Bootstrap typeahead填充国家/地区。我在jQuery中初始化typeahead,但是值没有出现在文本框中。如果我去掉ng-repeat,它就能完美地工作
<div ng-repeat='item in array'>
<input class="typeahead" type="text" id="Text23" ng-model="dtl.InstCn" ng-required="true" placeholder="Country">
</div>
<script>
$('.typeahead').typeahead({source: sourceArr});
</script>如何将typehead与ng-repeat一起使用?
发布于 2014-03-12 20:30:30
你能提供一个柱塞吗?我不能理解你的代码片段中的ng-repeat的含义。您没有使用ng-repeat中的任何内容。
或者使用AngularUI中的UI Bootstrap (用纯AngularJS编写的引导组件)试试:
http://angular-ui.github.io/bootstrap/#/typeahead
https://stackoverflow.com/questions/22350983
复制相似问题