onDeselectAll is not working as expected #446
Description
Hello @pkempenaers
If I am calling a function on Uncheck all, the same function also gets called when Check All is clicked.
my HTML Code
<div ng-dropdown-multiselect="" options="facilities" selected-model="invoice.facilities" extra-settings="multidropdownSettings" form-name="step_one_form" translation-texts="translationText" events="customEvents"></div>
My javaScript Code
$scope.customEvents = { onSelectAll: function () { console.log('checked') }, onUnselectAll: function () { console.log('unchecked') } };
When Uncheck is clicked, in console, only unchecked is printing. But if Check All is clicked, both checked and unchecked are printed.
My question is how to call a function only when Uncheck All is clicked? I even saw this . It did not help.
In addition to that the in angularjs-dropdown-multiselect.js the function selectAll contains following code.
$scope.selectAll = function () { $scope.deselectAll(false); $scope.externalEvents.onSelectAll(); angular.forEach($scope.options, function (value) { $scope.setSelectedItem(value[$scope.settings.idProp], true); }); };
If i remove/comment $scope.deselectAll(false);
, it works as expected.
Please do help me with this issue.