0

在此处输入图像描述

您好,我正在为多个自动完成实现 ui-select 角度指令。使用 angular 版本 1.2.18 它工作正常,但是当我使用 angular 1.5.5 时出现类似错误:无法在 ctrl.getplaceholder 处获取未定义或空引用的属性“长度”

我的 HTML 代码是:

<ui-select multiple tagging="tagTransform" tagging-tokens="SPACE|,|/" ng-model="demo.selectedPeople" style="width: 800px;">
    <ui-select-match placeholder="Select person...">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="person in people | propsFilter: {name: $select.search}">
        <div ng-if="person.isTag" ng-bind-html="person.name + ' ' + $select.taggingLabel | highlight: $select.search"></div>
        <div ng-if="!person.isTag" ng-bind-html="person.name| highlight: $select.search"></div>

    </ui-select-choices>
    </ui-select>

我的控制器代码是:

lampiApp.controller('DemoCtrl', function ($scope, $http) {


$scope.tagTransform = function (newTag) {
    var item = {
        name: newTag,

    };

    return item;
};

$scope.people=[];
var str = "January,February,March,April,May,June,July,August,September,October singh";
var splittedString = str.split(',');
var arr = [];
splittedString.forEach(function (v) {
    arr.push({ name: v });
});

$scope.people = arr;

});
4

1 回答 1

0
1.This was the Error that is related to angular version i figure out the solution by myself , see it at this Plnkr
2.http://plnkr.co/edit/230zLWeyACfReVaPZ0LM?p=preview
于 2016-08-19T11:38:07.223 回答