MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / groupScan

Function groupScan

test/fixtures/foo.js:6232–6255  ·  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

6230 * @returns {*}
6231 */
6232 function groupScan(node, attrStart, attrEnd) {
6233 var nodes = [];
6234 var depth = 0;
6235 if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
6236 var startNode = node;
6237 do {
6238 if (!node) {
6239 throw $compileMinErr('uterdir',
6240 "Unterminated attribute, found '{0}' but no matching '{1}' found.",
6241 attrStart, attrEnd);
6242 }
6243 if (node.nodeType == 1 /** Element **/) {
6244 if (node.hasAttribute(attrStart)) depth++;
6245 if (node.hasAttribute(attrEnd)) depth--;
6246 }
6247 nodes.push(node);
6248 node = node.nextSibling;
6249 } while (depth > 0);
6250 } else {
6251 nodes.push(node);
6252 }
6253
6254 return jqLite(nodes);
6255 }
6256
6257 /**
6258 * Wrapper for linking function which converts normal linking function into a grouped

Callers 2

applyDirectivesToNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected