AngularJS Example:
by stevenkaspar
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div ng-app>
<div ng-controller="TodoCtrl">
<div ng-if="Type.Value == 'Gadgets'">
<div class="form-group radioChkBtn">
<label class="col-sm-3 control-label">Device Type</label>
<div class="col-sm-7">
<div class="radio" ng-repeat="type in Types">
<input type="radio" ng-model="type.DeviceType" ng-value="type.Value" ng-click='setDeviceType(type)' id="radioDeviceType{{$index}}" name="devicetype"><label for="radioDeviceType{{$index}}"> {{type.Value}}</label>
</div>
<button ng-click='log()'>
log
</button>
</div>
</div>
</div>
JavaScript
function TodoCtrl($scope) {
$scope.Type = {
value: 'Gadgets'
}
$scope.Types = [
{
Value: 1
},
{
Value: 2
}
]
$scope.DeviceType;
$scope.setDeviceType = function(type){
$scope.DeviceType = type.DeviceType;
}
$scope.log = function(type){
console.log($scope.DeviceType);
}
}