mercredi 21 octobre 2015

Change input -> change checkbox model without click

If you update text input model "sg.Value", checkbox shoud be checked, but model "sg.AnswerId" is not set.

How to get:

Change text input -> Set checkbox model ?

<label>
  <input type="checkbox"
         ng-model="sg.AnswerId"
         ng-true-value="'{{answer.Id}}'"
         ng-checked="sg.Value != undefined"
         >
  <input type="text"
         placeholder="Your text"
         ng-model="sg.Value"
         >
</label>

Checkbox must become checked and it's model update, when i type in input.




Aucun commentaire:

Enregistrer un commentaire