F
F
Friend2016-10-15 23:38:32
Angular
Friend, 2016-10-15 23:38:32

How to uncheck CheckBox when using ng-show?

<input type="checkbox" data-ng-model='one' data-ng-true-value='one' data-ng-false-value='' /> Первый<br>
<input type="checkbox" data-ng-model='two' data-ng-true-value='two' data-ng-false-value='' data-ng-show="!one"/> Второй<br>

The problem with the CheckBox, when the "Second" is hidden and there was a checkmark on it, when you open it, it still has a checkmark on it. How to uncheck the box when hiding it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2016-10-16
@erniesto77

you can create a status variable in the scope, for example ... and change it at the right time. Along with it, the checkbox attribute ng-disabled="status === 'disabled''" // true | false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question