ui-select2
ui-select2 copied to clipboard
How to get the change event of select2 when using with angular-ui/ui-select2
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
};
This is not what you are asking but may be helpful.
$scope.$watch("SelectedTemplate",function(newValue){
console.log(newValue);
});
@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?