When we are using UI-Select we need to reset the selected Item.
We can achieve this by using
<ui-select id="organization" ng-model="data.SelectedOrganization" class="form-control-static" on-select="onSelectedOrg()" > <ui-select-match placeholder=" select a organization..."> {{$select.selected.Text}} </ui-select-match> <ui-select-choices repeat="org in data.Organizations | propsFilter: {Text: $select.search}" refresh="refreshOrgs($select.search)" refresh-delay="0"> <div ng-bind-html="org.Text | highlight: $select.search"></div> </ui-select-choices> </ui-select>
<input id="clear" type="Button" value="Clear" ng-click="clear()" />
Javascript
$scope.clear = function () { $scope.data.SelectedOrganization = undefined; };
Awesome blog with lots of information. It is really helpful for all.
ReplyDeleteAngularJS Training in Chennai
AngularJS course in Chennai
Angular 6 Training in Chennai
ReactJS Training in Chennai
PHP Training in Chennai
Web Designing course in Chennai
Tally course in Chennai
AngularJS Training in Velachery
AngularJS Training in T Nagar
AngularJS Training in OMR