Radio input directives

Description

The following code shows how to use radio input directives.

Example


<!DOCTYPE html>
<html  ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from  w w  w. jav  a2s . co  m-->
<body>
  <h1>User Info</h1>
  <label>Sex</label>
  <label class="radio">
     <input type="radio" 
            ng-model="user.sex" 
            value="male"> Male</label>
  <label class="radio">
     <input type="radio" 
            ng-model="user.sex" 
            value="female"> Female</label>
  
  <pre ng-bind="user | json"></pre>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities