简体   繁体   English

在oi.select angularjs如何清洁选定的项目

[英]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. 这是oi选择选项。 I want to know the way how to clean the oi.select option by clicked Next button. 我想通过单击“下一步”按钮来了解如何清洁oi.select选项的方法。 How to write this in angular way? 如何用角度的方式写这个? Thanks. 谢谢。

Here is the plunker with a working example 这是一个有工作例子的pl夫

In your problem, your ng-model="ManualQuickDeposit.service" 在您ng-model="ManualQuickDeposit.service"问题中,您的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 因此,您的按钮ng-click将为ng-click="Next()"不需要额外的参数,在您的控制器中,您可以执行以下操作

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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