简体   繁体   中英

in oi.select angularjs How to clean selected item

  <div class="col-sm-5">
    <oi-select oi-options="service.ServiceName for service in services track by  service.ServiceID" id="ServiceID" ng-model="ManualQuickDeposit.service" placeholder="Select Service" name="service" required>
    </oi-select>
    </div>

button

 <button id="divApply"  class="btn btn-info" type="button" ng-click="Next(ManualQuickDeposit)" style="width: 80px;">
                        Update
                    </button>

This is oi select options. I want to know the way how to clean the oi.select option by clicked Next button. How to write this in angular way? Thanks.

Here is the plunker with a working example

In your problem, your ng-model="ManualQuickDeposit.service"
so your button ng-click will be ng-click="Next()" no need extra parameter and in your controller you can do as below

$scope.Next = function () {
   $scope.ManualQuickDeposit.service = [];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM