angularjs-dropdown-multiselect icon indicating copy to clipboard operation
angularjs-dropdown-multiselect copied to clipboard

onDeselectAll event is fired before selectedModel is cleared

Open indusbull opened this issue 8 years ago • 0 comments

Currently, onDeselectAll event is fired before selectedModel is cleared. In my use case, it makes more sense to fire the event after selectedModel object is cleared. So my app can take necessary actions just based on values in selectedModel. But in this case, I first have to explicitly clear my app model when event fires. What are the other use cases where event needs to be fired before selectedModel is cleared?

` $scope.deselectAll = function (sendEvent) { sendEvent = angular.isDefined(sendEvent) ? sendEvent : true;
if (sendEvent) { $scope.externalEvents.onDeselectAll($scope.options);

                if ($scope.singleSelection) {
                    clearObject($scope.selectedModel);
                } else {
                	if(!_.isNil($scope.selectedModel)){
                		$scope.selectedModel.splice(0, $scope.selectedModel.length);
                	}
                }
               
             }

}`

indusbull avatar Sep 26 '17 14:09 indusbull