如何将其翻译为Ionic 2?
<div class="weightunitradios">
<ion-checkbox
class="checkboxes"
ng-model="data.weightunit"
ng-true-value="'kg'"
ng-false-value="'lbs'"
ng-change="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">
kg
</ion-checkbox>
<ion-checkbox
class="checkboxes"
ng-model="data.weightunit"
ng-true-value="'lbs'"
ng-false-value="'kg'"
ng-change="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">
lbs
</ion-checkbox>
</div>
我尝试了此操作,但行为并非我所期望的,我一次只能选择一个无线电:
<ion-list class="weightunitradios">
<ion-item>
<ion-label>kg</ion-label>
<ion-checkbox
mode="ios"
value="kg"
[(ngModel)]="data.weightunit"
ngTrueValue="'kg'"
ngFalseValue="'lbs'"
(ionChange)="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">
</ion-checkbox>
</ion-item>
<ion-item>
<ion-label>lbs</ion-label>
<ion-checkbox
mode="ios"
value="lbs"
[(ngModel)]="data.weightunit"
(ionChange)="saveWeightUnit(); changeMinMax(); convertWeightInput(); saveUserWeight();">
</ion-checkbox>
</ion-item>
</ion-list>