Home
Run >
<!DOCTYPE html> <html> <head> <!-- www.techstrikers.com --> <title>AngularJS Input Type Radio</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script> <script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js"></script> <script> var app = angular.module('radioInputExample', []) app.run(function($rootScope){ $rootScope.angular = angular; }) app.controller('RadioController', ['$scope', function($scope) { $scope.example = { color:'yellow' }; }]); </script> </head> <body style="background-color:#DDE4E9;"> <fieldset style="background-color:#DDE4E9;"> <legend>AngulerJS Input Type Radio Example</legend> <div ng-app="radioInputExample"> <form name="myForm" ng-controller="RadioController"> <input type="radio" ng-model="example.color" value="yellow"/> <label for="exampleInput">Yellow</label><br/> <input type="radio" ng-model="example.color" value="red"/> <label for="exampleInput">Red</label> <br/> <input type="radio" ng-model="example.color" value="blue"/> <label for="exampleInput">Blue</label> <br/> <p style="font-family:Arial;color:red;background:{{ example.color}};padding:3px;width:350px;"> </p> </form> </div> </fieldset> </body> </html>