HTML radio button.
All inputs controlled by ngModel (including those of type
radio) will use the value of their
name attribute to determine the property under which their NgModelController will be published on the parent FormController. Thus, if you use the same
name for multiple inputs of a form (e.g. a group of radio inputs), only one
NgModelController will be published on the parent
FormController under that name. The rest of the controllers will continue to work as expected, but you won't be able to access them as properties on the parent
In plain HTML forms, the
name attribute is used to identify groups of radio inputs, so that the browser can manage their state (checked/unchecked) based on the state of other inputs in the same group.
In AngularJS forms, this is not necessary. The input's state will be updated based on the value of the underlying model data.
nameattribute on a radio input,
ngModelwill automatically assign it a unique name.
<input type="radio" ng-model="string" value="string" [name="string"] [ng-change="string"] ng-value="string">
|ngModel|| || |
Assignable AngularJS expression to data-bind to.
|value|| || |
The value to which the
| name |
| || |
Property name of the form under which the control is published.
| ngChange |
| || |
AngularJS expression to be executed when input changes due to user interaction with the input element.
|ngValue|| || |
AngularJS expression to which
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.