0

ここに画像の説明を入力

こんにちは、複数のオートコンプリート用に ui-select angular ディレクティブを実装しています。angularバージョン1.2.18では正常に動作しますが、angular 1.5.5で使用すると、次のようなエラーが発生します: Unable to get property 'length' of undefined or null reference at 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 に答える