Changing input-model in on-open callback doesn't update the multiselect
Hi isteven, In my project I'm changing the input model in on-open callback and I want these changes to be visible on the fly. Few days ago I updated from 3.0.0 to 4.0.0. Now, when data is appended to the input model in on-open method, the directive doesn't update immediately. It updates when the multiselect is opened for the second time.
I'm pretty sure that this worked differently in 3.0.0.
Here's the plunker: http://plnkr.co/edit/BHHnk0
Regards
Hi @tjaniec ,
Thanks for replicating it. Much appreciated. I'll have a look into the issue.
My rough guess is that I changed the way it refreshes data for performance reasons.
I load my data from a database on this way:
var init = function () { $rootScope.$broadcast('loadProjectDatas'); };
init();
$http.post('/DesktopModules/Deufol_Services/api/ProjectService/loadProjectObjectListData', request). success(function (data, status, headers, config) { loadedData = data; DataToDropDown(); }
var DataToDropDown = function () { var arr = []; if (loadedData.length === 0) { return; } for (var i = 0; i < loadedData.length; i++) { arr.push(new Object({ id: loadedData[i].projectNo.toString(), bez: loadedData[i].projectText.toString() })); }; $scope.dataToShow = angular.copy(arr); };
It runs fine, but then i open the Multiselect, it is empty.
What´s my error? Any way to refresh the Multiselect?