Arvind Chaudhary Arvind Chaudhary - 3 months ago 25
AngularJS Question

Unable to get property 'length' of undefined or null reference at ctrl.getplaceholder in ui-select.js

enter image description here

Hello I am implementing ui-select angular directive for multiple auto complete. with angular version 1.2.18 it workes fine but when i used with angular 1.5.5 getting an Error like :
Unable to get property 'length' of undefined or null reference at ctrl.getplaceholder

My Html Code is :

<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>




My Controller Code is:

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;

});

Answer
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