Closed rodcloutier closed 11 years ago
Hi, there are two problems in your example:
name
attribute on the first set of radio buttons. By this, jqm does not know that they belong together, and that's the reason why the stay pressed.ng-repeat
creates a nested scope for every radio button, and you want to change the property value
of the parent scope, you have to use ng-model="$parent.value"
instead of ng-model="value"
. Skipping the $parent
works fine for reading, as nested scopes inherit from parents, but not for writing, as then the property value
is created in the nested scope.Together, your input needs to look like this:
<label ng-repeat="l in values">{{l.label}}
<input type="radio" name="radio-choice-h-1" ng-model="$parent.value" value="{{l.value}}">
</label>
Here is a corrected jsfiddle that works: http://jsfiddle.net/tigbro/ZHKBA/121/
Closing this as not a bug... Tobias
Thanks Tobias makes a lot of sense now that I see it...
Selecting the buttons does not update the model or trigger the radio group behaviour.
Changing the model binding updates the radio group but only if a button has not been pressed.
See the following fiddle http://jsfiddle.net/ZHKBA/119/