MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / urlInputType

Function urlInputType

web/static/bower_components/angular/angular.js:21953–21964  ·  view source on GitHub ↗
(scope, element, attr, ctrl, $sniffer, $browser)

Source from the content-addressed store, hash-verified

21951}
21952
21953function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
21954 // Note: no badInputChecker here by purpose as `url` is only a validation
21955 // in browsers, i.e. we can always read out input.value even if it is not valid!
21956 baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
21957 stringBasedInputType(ctrl);
21958
21959 ctrl.$$parserName = 'url';
21960 ctrl.$validators.url = function(modelValue, viewValue) {
21961 var value = modelValue || viewValue;
21962 return ctrl.$isEmpty(value) || URL_REGEXP.test(value);
21963 };
21964}
21965
21966function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
21967 // Note: no badInputChecker here by purpose as `url` is only a validation

Callers

nothing calls this directly

Calls 2

baseInputTypeFunction · 0.85
stringBasedInputTypeFunction · 0.85

Tested by

no test coverage detected