<ion-toggle ng-model="this.customerchecked" toggle-class="toggle-calm" ng-disabled="this.one || this.two" ng-change="customerEngaged()"> Customer Engaged </ion-toggle>
<div class="list card">
<ion-toggle ng-model="this.one" toggle-class="toggle-calm" ng-change="oneChange()"> One </ion-toggle>
<ion-toggle ng-model="this.two" toggle-class="toggle-calm" ng-change="twoChange()"> Two </ion-toggle>
</div>
答案 0 :(得分:0)
如果你想要禁用离子切换,你需要一个为真或两个为真,所以如果你想要启用离子切换,你需要假的和两个是假的
答案 1 :(得分:0)
<ion-toggle ng-model="data.toggleOne" ng-true-value="'varTrue'" ng-false-value="'varFalse'" ng-change="toggleServiceState(data.toggleOne)" toggle-class="toggle-calm">Name of Toggle</ion-toggle>
如果“this.one”是简单类型,如string,int等使用它并从控制器更改它不是那么简单如果你想在离子(和ofc angular)中使用双数据绑定你必须记住那个简单类型不使用它(它必须反对)。当您将每个切换值放入对象时,您可以更改它(从控制器站点更改UI)