码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS的angucomplete-alt

时间:2017-10-14 18:41:31      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:control   size   min   for   data-   out   scope   arch   -o   

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() {
            ... ...
        }

 

angucomplete-alt 文档

AngularJS的angucomplete-alt

标签:control   size   min   for   data-   out   scope   arch   -o   

原文地址:http://www.cnblogs.com/miny-simp/p/7667709.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!