-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi guys,
I have noticed the following error in the console:
Error: data is undefined
have traced it to the following bit of code in selectize-ng:
if (attrs.options) {
scope.$parent.$watchCollection(attrs.options, setSelectizeOptions);
}
I guess the expected behaviour here is that #watchCollection will only execute listener function (setSelectizeOptions) when there are new values.
However, I have added the following line into setSelectizeOptions function and confirmed that sometimes it is being called even without the newOptions argument:
function setSelectizeOptions(newOptions) {
if(newOptions==null){
console.log("newOptions were NULL");
}
var values = parseValues(ngModel.$viewValue);
selectize.addOption(newOptions);
selectize.refreshOptions(false);
if (options.mode === 'multi' && newOptions) {
restoreInvalidValues(newOptions, values);
}
setSelectizeValue(values);
}
Has anyone else had similar behaviour?
Metadata
Metadata
Assignees
Labels
No labels