Hello, I’m trying to disable a toggle based on another toggle’s value. The angular way suggest this:
<input type="checkbox" ng-model="check"> </input>
<input type="checkbox" ng-disabled="check">Checkbox to be disabled</input>
like in this fiddle http://jsfiddle.net/DotDotDot/FJf4v/11/
However, using ionic toggle directive I can’t make this possible. This is my markup
<form>
<ul class="list">
<li class="item item-toggle">
Activate Fraud Alert reminder
<toggle ng-model="alertIsActive" ng-true-value="1" ng-false-value="0"></toggle>
</li>
</ul>
<div class="list">
<label class="item item-input item-stacked-label">
<span class="input-label white">Date Field</span>
<input type="date" ng-model="startDt" ui-date ng-disabled="alertIsActive == 0">
</label>
</div>
<ul class="list">
<li class="item item-toggle">
Toggle1
<label class="toggle">
<input type="checkbox" ng-disabled="alertIsActive == 0">
<div class="track">
<div class="handle"></div>
</div>
</label>
</li>
<li class="item item-toggle" ng-disabled="alertIsActive == 0">
Toggle2
<toggle type="checkbox" ng-disabled="alertIsActive == 0"></toggle>
</li>
</ul>
</form>
I tried using ng-true-value=1 and ng-false-value=0 cause that came up in my research, but it didn’t make any difference. When I switch the first toggle on/off, the date input gets disabled just right, however, the other two toggles don’t. I use the two different forms to create toggles as in the documentation. Using the long form (Toggle1) the toggle never gets disabled. Using the second form (Toggle2) the toggle is always disabled. I’ve seen some issues about radio and toggles in ionic’s github about they being a little bit broken, but i don’t know if this issue is related. Thanks in advance.