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

Function groupScan

test/angular/1.2/angular.js:6307–6330  ·  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

6305 * @returns {*}
6306 */
6307 function groupScan(node, attrStart, attrEnd) {
6308 var nodes = [];
6309 var depth = 0;
6310 if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
6311 var startNode = node;
6312 do {
6313 if (!node) {
6314 throw $compileMinErr('uterdir',
6315 "Unterminated attribute, found '{0}' but no matching '{1}' found.",
6316 attrStart, attrEnd);
6317 }
6318 if (node.nodeType == 1 /** Element **/) {
6319 if (node.hasAttribute(attrStart)) depth++;
6320 if (node.hasAttribute(attrEnd)) depth--;
6321 }
6322 nodes.push(node);
6323 node = node.nextSibling;
6324 } while (depth > 0);
6325 } else {
6326 nodes.push(node);
6327 }
6328
6329 return jqLite(nodes);
6330 }
6331
6332 /**
6333 * 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