MCPcopy Create free account
hub / github.com/angular-ui/ui-router / groupScan

Function groupScan

test/angular/1.4/angular.js:8129–8151  ·  view source on GitHub ↗

* Given a node with an directive-start it collects all of the siblings until it finds * directive-end. * @param node * @param attrStart * @param attrEnd * @returns {*}

(node, attrStart, attrEnd)

Source from the content-addressed store, hash-verified

8127 * @returns {*}
8128 */
8129 function groupScan(node, attrStart, attrEnd) {
8130 var nodes = [];
8131 var depth = 0;
8132 if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
8133 do {
8134 if (!node) {
8135 throw $compileMinErr('uterdir',
8136 "Unterminated attribute, found '{0}' but no matching '{1}' found.",
8137 attrStart, attrEnd);
8138 }
8139 if (node.nodeType == NODE_TYPE_ELEMENT) {
8140 if (node.hasAttribute(attrStart)) depth++;
8141 if (node.hasAttribute(attrEnd)) depth--;
8142 }
8143 nodes.push(node);
8144 node = node.nextSibling;
8145 } while (depth > 0);
8146 } else {
8147 nodes.push(node);
8148 }
8149
8150 return jqLite(nodes);
8151 }
8152
8153 /**
8154 * Wrapper for linking function which converts normal linking function into a grouped

Callers 2

applyDirectivesToNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected