isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

Add option to show custom label on some options selected #424

Open pmomot opened 8 years ago

pmomot commented 8 years ago

There is need in option, like

'someSelectedLabel': 'Recipients selected'

that provides ability instead of showing every selected option in

.multiSelect > button

show only this label. Because in some cases users don't need to see all selected options, they need to know, that something is selected and this is enough.

None selected: http://prntscr.com/ajqxxw Some selected: http://prntscr.com/ajqyc5

lybing commented 8 years ago
  1. add showSelectedText : '=', into scope
  2. ` $scope.$watch("showSelectedText" , function( newVal ) {

           if( newVal ) {
               $scope.showSelectedText = newVal;
           }
       });`
  3. add a judgement for refreshbutton: else if (typeof $scope.showSelectedText !== 'undefined' && $scope.showSelectedText !== "") { //https://github.com/isteven/angular-multi-select/issues/424 $scope.varButtonLabel = $scope.showSelectedText; } isteven-multi-select.zip
isteven commented 8 years ago

@pmomot ,

Sorry for the late reply;

Indeed there are some requests regarding custom text on the button. I'll see what I can do for the next release.