MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / radioInputType

Function radioInputType

test/fixtures/foo.js:17197–17217  ·  view source on GitHub ↗
(scope, element, attr, ctrl)

Source from the content-addressed store, hash-verified

17195}
17196
17197function radioInputType(scope, element, attr, ctrl) {
17198 // make the name unique, if not defined
17199 if (isUndefined(attr.name)) {
17200 element.attr('name', nextUid());
17201 }
17202
17203 element.on('click', function() {
17204 if (element[0].checked) {
17205 scope.$apply(function() {
17206 ctrl.$setViewValue(attr.value);
17207 });
17208 }
17209 });
17210
17211 ctrl.$render = function() {
17212 var value = attr.value;
17213 element[0].checked = (value == ctrl.$viewValue);
17214 };
17215
17216 attr.$observe('value', ctrl.$render);
17217}
17218
17219function checkboxInputType(scope, element, attr, ctrl) {
17220 var trueValue = attr.ngTrueValue,

Callers

nothing calls this directly

Calls 2

isUndefinedFunction · 0.85
nextUidFunction · 0.85

Tested by

no test coverage detected