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

Function jqLiteInheritedData

test/angular/1.3/angular.js:2716–2734  ·  view source on GitHub ↗
(element, name, value)

Source from the content-addressed store, hash-verified

2714}
2715
2716function jqLiteInheritedData(element, name, value) {
2717 // if element is the document object work with the html element instead
2718 // this makes $(document).scope() possible
2719 if (element.nodeType == NODE_TYPE_DOCUMENT) {
2720 element = element.documentElement;
2721 }
2722 var names = isArray(name) ? name : [name];
2723
2724 while (element) {
2725 for (var i = 0, ii = names.length; i < ii; i++) {
2726 if ((value = jqLite.data(element, names[i])) !== undefined) return value;
2727 }
2728
2729 // If dealing with a document fragment node with a host element, and no parent, use the host
2730 // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
2731 // to lookup parent controllers.
2732 element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
2733 }
2734}
2735
2736function jqLiteEmpty(element) {
2737 jqLiteDealoc(element, true);

Callers 2

jqLiteControllerFunction · 0.70
angular.jsFile · 0.70

Calls 1

isArrayFunction · 0.85

Tested by

no test coverage detected