Angular: radio buttons rc4
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.0rc4.js"></script>
<div ng-controller="MyCtrl">
Hello, {{name}}!
<form>
<input name="UseBools" type="radio" ng-model="theBoolean" ng-value="true" ng-click="checkOther($event)" >Yes <br/>
<hr/>
<input name="zap" type="radio" ng-model="color" ng-change='set("red")'> Red <br/>
<input name="zap" type="radio" ng-model="color" ng-change='set("red")'> Green <br/>
<input name="zap" type="radio" ng-model="color" ng-change='set("red")' > Blue <br/>
{{color}}
</form>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
/*myApp.directive('value', function ($parse) {
return function (scope, element, attrs) {
if (attrs.ngModel) {
if (element[0].type == "radio") {
if (element[0].checked == true) {
$parse(attrs.ngModel).assign(scope, attrs.value);
}
} else {
$parse(attrs.ngModel).assign(scope, attrs.value);
}
}
};
})
*/
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.checkOther = function(event) {
}
}