(scope, element, attr, ctrl)
| 19881 | } |
| 19882 | |
| 19883 | function 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 | |
| 19905 | function parseConstantExpr($parse, context, name, expression, fallback) { |
| 19906 | var parseFn; |
nothing calls this directly
no test coverage detected