MCPcopy Create free account
hub / github.com/apache/cloudstack / radioInputType

Function radioInputType

tools/ngui/static/js/lib/angular.js:11717–11737  ·  view source on GitHub ↗
(scope, element, attr, ctrl)

Source from the content-addressed store, hash-verified

11715}
11716
11717function radioInputType(scope, element, attr, ctrl) {
11718 // make the name unique, if not defined
11719 if (isUndefined(attr.name)) {
11720 element.attr('name', nextUid());
11721 }
11722
11723 element.bind('click', function() {
11724 if (element[0].checked) {
11725 scope.$apply(function() {
11726 ctrl.$setViewValue(attr.value);
11727 });
11728 }
11729 });
11730
11731 ctrl.$render = function() {
11732 var value = attr.value;
11733 element[0].checked = (value == ctrl.$viewValue);
11734 };
11735
11736 attr.$observe('value', ctrl.$render);
11737}
11738
11739function checkboxInputType(scope, element, attr, ctrl) {
11740 var trueValue = attr.ngTrueValue,

Callers

nothing calls this directly

Calls 2

isUndefinedFunction · 0.85
nextUidFunction · 0.85

Tested by

no test coverage detected