ui-select2 icon indicating copy to clipboard operation
ui-select2 copied to clipboard

How to get the change event of select2 when using with angular-ui/ui-select2

Open yrshaikh opened this issue 10 years ago • 2 comments

Hi,

I followed the basic example mentioned on the site.

However I am unable to find how to get the change event of the select2? whats the syntax ?

<select data-ui-select2="select2Options" data-ng-model="SelectedTemplate" data-placeholder="Pick a number">
 <option value=""></option>
  <option value="one">First</option>
  <option value="two">Second</option>
  <option value="three">Third</option>
 </select>

and

$scope.select2Options = {
        allowClear: true
    };

yrshaikh avatar Jun 17 '14 08:06 yrshaikh

This is not what you are asking but may be helpful.

 $scope.$watch("SelectedTemplate",function(newValue){
              console.log(newValue); 
        });

mkamayd avatar Jun 24 '14 14:06 mkamayd

@yrshaikh Have you resolved the question? i wonder why ng-change does not work,or i just want to know the event which is equal to ng-change,i do not want to use the watch,because watch will work once the data inits, i do not want to let watch work when the data inits.Do you have a better method?

ruth8 avatar Apr 26 '18 08:04 ruth8