This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Async data tons of errors in console #380
Open
Description
Hi,
I'm trying to load async data and then group by them and I get tons of error in the console which leads to group by not working sometimes:
<ui-select multiple ng-model="current.ids" name="userPlans" theme="select2" ng-disabled="disabled" class="med">
<ui-select-match>{{$item.name}}</ui-select-match>
<ui-select-choices group-by="getCityName" repeat="person.id as person in peopleList | propsFilter: {name: $select.search}">
<div ng-bind-html="person.name | highlight: $select.search"></div>
{{person.name}}
</ui-select-choices>
</ui-select>
$scope.getCityName = function(item) {
return $scope.cities[item.cityId].name;
}
and errors are these:
TypeError: Cannot read property 'length' of undefined
at angular.module.constant.service.service.controller.p.getPlaceholder (http://localhost:4000/lib/ui-select/select.min.js:7:6353)
at cb.functionCall (http://localhost:4000/lib/angularjs/angular.min.js:196:254)
at Object.<anonymous> (http://localhost:4000/lib/angularjs/angular.min.js:105:217)
at h.$get.h.$digest (http://localhost:4000/lib/angularjs/angular.min.js:120:246)
at h.$get.h.$apply (http://localhost:4000/lib/angularjs/angular.min.js:123:334)
at n (http://localhost:4000/lib/angularjs/angular.min.js:80:80)
at O (http://localhost:4000/lib/angularjs/angular.min.js:84:150)
at XMLHttpRequest.D.onload (http://localhost:4000/lib/angularjs/angular.min.js:85:169)
and
TypeError: Cannot read property 'indexOf' of undefined
at http://localhost:4000/lib/ui-select/select.min.js:7:4860
at Array.filter (native)
at http://localhost:4000/lib/ui-select/select.min.js:7:4824
at Object.fn (http://localhost:4000/lib/angularjs/angular.min.js:119:304)
at h.$get.h.$digest (http://localhost:4000/lib/angularjs/angular.min.js:120:381)
at h.$get.h.$apply (http://localhost:4000/lib/angularjs/angular.min.js:123:334)
at n (http://localhost:4000/lib/angularjs/angular.min.js:80:80)
at O (http://localhost:4000/lib/angularjs/angular.min.js:84:150)
at XMLHttpRequest.D.onload (http://localhost:4000/lib/angularjs/angular.min.js:85:169)
and
TypeError: Cannot read property 'length' of undefined
at Array.<anonymous> (http://localhost:4000/lib/ui-select/select.min.js:7:7922)
at Vf.$$parseAndValidate (http://localhost:4000/lib/angularjs/angular.min.js:214:437)
at Vf.$commitViewValue (http://localhost:4000/lib/angularjs/angular.min.js:214:272)
at Vf.$$debounceViewValueCommit (http://localhost:4000/lib/angularjs/angular.min.js:216:191)
at Vf.$setViewValue (http://localhost:4000/lib/angularjs/angular.min.js:215:442)
at http://localhost:4000/lib/ui-select/select.min.js:7:10169
at Object.fn (http://localhost:4000/lib/angularjs/angular.min.js:119:294)
at h.$get.h.$digest (http://localhost:4000/lib/angularjs/angular.min.js:120:381)
at h.$get.h.$apply (http://localhost:4000/lib/angularjs/angular.min.js:123:334)
at n (http://localhost:4000/lib/angularjs/angular.min.js:80:80)
and
TypeError: Cannot read property 'length' of undefined
at http://localhost:4000/lib/ui-select/select.min.js:7:5018
at Object.fn (http://localhost:4000/lib/angularjs/angular.min.js:119:294)
at h.$get.h.$digest (http://localhost:4000/lib/angularjs/angular.min.js:120:381)
at h.$get.h.$apply (http://localhost:4000/lib/angularjs/angular.min.js:123:334)
at n (http://localhost:4000/lib/angularjs/angular.min.js:80:80)
at O (http://localhost:4000/lib/angularjs/angular.min.js:84:150)
at XMLHttpRequest.D.onload (http://localhost:4000/lib/angularjs/angular.min.js:85:169)
apparently data is not ready when the directive is trying to access it.