Search code examples
angularjsangularjs-directiveangularjs-scope

AngularJS On selecting radio button set select field value


How do I set the select fields value by clicking radio button

like the one below


Solution

  • <input type="radio"
       ng-model="string"
       value="string"
       [name="string"]
       [ng-change="string"]
       ng-value="string">
    

    Value Used :- The value to which the ngModel expression should be set when selected. Note that value only supports string values, i.e. the scope model needs to be a string, too. Use ngValue if you need complex models (number, object, ...).