AngularJS的angucomplete-alt
Posted miny_simp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AngularJS的angucomplete-alt相关的知识,希望对你有一定的参考价值。
html:
1 <div angucomplete-alt 2 id="teacherName" 3 placeholder="查询" 4 pause="500" 5 selected-object="selectedTeacher" 6 remote-url-data-field="" 7 remote-api-handler="searchTeacher" 8 title-field="name,deptName,userId" 9 description-field="name,deptName,userId" 10 text-no-results="未找到,请手动添加" 11 minlength="1" 12 input-class="form-control" 13 match-class="highlight"> 14 </div>
JS:
/** * 搜索 */ $scope.searchTeacher = function(userInputString, timeoutPromise) { ... ... }; ... ... /** * 选中 */ $scope.selectedTeacher = function(selected) { ... ... $scope.addTeacher(); $scope.$broadcast(‘angucomplete-alt:clearInput‘); //清空input }; /** * 添加 */ $scope.addTeacher = function() { ... ... }
以上是关于AngularJS的angucomplete-alt的主要内容,如果未能解决你的问题,请参考以下文章