MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / radioInputType

Function radioInputType

code/songhop/www/lib/angular/angular.js:19883–19903  ·  view source on GitHub ↗
(scope, element, attr, ctrl)

Source from the content-addressed store, hash-verified

19881}
19882
19883function radioInputType(scope, element, attr, ctrl) {
19884 // make the name unique, if not defined
19885 if (isUndefined(attr.name)) {
19886 element.attr('name', nextUid());
19887 }
19888
19889 var listener = function(ev) {
19890 if (element[0].checked) {
19891 ctrl.$setViewValue(attr.value, ev && ev.type);
19892 }
19893 };
19894
19895 element.on('click', listener);
19896
19897 ctrl.$render = function() {
19898 var value = attr.value;
19899 element[0].checked = (value == ctrl.$viewValue);
19900 };
19901
19902 attr.$observe('value', ctrl.$render);
19903}
19904
19905function parseConstantExpr($parse, context, name, expression, fallback) {
19906 var parseFn;

Callers

nothing calls this directly

Calls 2

isUndefinedFunction · 0.70
nextUidFunction · 0.70

Tested by

no test coverage detected