MCPcopy
hub / github.com/angular-ui/ui-router / jqLiteInheritedData

Function jqLiteInheritedData

test/angular/1.7/angular.js:3471–3489  ·  view source on GitHub ↗
(element, name, value)

Source from the content-addressed store, hash-verified

3469}
3470
3471function jqLiteInheritedData(element, name, value) {
3472 // if element is the document object work with the html element instead
3473 // this makes $(document).scope() possible
3474 if (element.nodeType === NODE_TYPE_DOCUMENT) {
3475 element = element.documentElement;
3476 }
3477 var names = isArray(name) ? name : [name];
3478
3479 while (element) {
3480 for (var i = 0, ii = names.length; i < ii; i++) {
3481 if (isDefined(value = jqLite.data(element, names[i]))) return value;
3482 }
3483
3484 // If dealing with a document fragment node with a host element, and no parent, use the host
3485 // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
3486 // to lookup parent controllers.
3487 element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
3488 }
3489}
3490
3491function jqLiteEmpty(element) {
3492 jqLiteDealoc(element, true);

Callers 2

jqLiteControllerFunction · 0.70
angular.jsFile · 0.70

Calls 2

isArrayFunction · 0.85
isDefinedFunction · 0.70

Tested by

no test coverage detected