lib/clientsidescripts.js
function findRepeaterRows(repeater, exact, index, using) {
  using = using || document;

  var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:'];
  var rows = [];
  for (var p = 0; p < prefixes.length; ++p) {
    var attr = prefixes[p] + 'repeat';
    var repeatElems = using.querySelectorAll('[' + attr + ']');
    attr = attr.replace(/\\/g, '');
    for (var i = 0; i < repeatElems.length; ++i) {
      if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
        rows.push(repeatElems[i]);
      }
    }
  }
  /* multiRows is an array of arrays, where each inner array contains
     one row of elements. */
  var multiRows = [];
  for (var p = 0; p < prefixes.length; ++p) {
    var attr = prefixes[p] + 'repeat-start';
    var repeatElems = using.querySelectorAll('[' + attr + ']');
    attr = attr.replace(/\\/g, '');
    for (var i = 0; i < repeatElems.length; ++i) {
      if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
        var elem = repeatElems[i];
        var row = [];
        while (elem.nodeType != 8 ||
            !repeaterMatch(elem.nodeValue, repeater)) {
          if (elem.nodeType == 1) {
            row.push(elem);
          }
          elem = elem.nextSibling;
        }
        multiRows.push(row);
      }
    }
  }
  var row = rows[index] || [], multiRow = multiRows[index] || [];
  return [].concat(row, multiRow);
}
function findRepeaterRows(repeater, exact, index, using) {
  using = using || document;

  var prefixes = ['ng-', 'ng_', 'data-ng-', 'x-ng-', 'ng\\:'];
  var rows = [];
  for (var p = 0; p < prefixes.length; ++p) {
    var attr = prefixes[p] + 'repeat';
    var repeatElems = using.querySelectorAll('[' + attr + ']');
    attr = attr.replace(/\\/g, '');
    for (var i = 0; i < repeatElems.length; ++i) {
      if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
        rows.push(repeatElems[i]);
      }
    }
  }
  /* multiRows is an array of arrays, where each inner array contains
     one row of elements. */
  var multiRows = [];
  for (var p = 0; p < prefixes.length; ++p) {
    var attr = prefixes[p] + 'repeat-start';
    var repeatElems = using.querySelectorAll('[' + attr + ']');
    attr = attr.replace(/\\/g, '');
    for (var i = 0; i < repeatElems.length; ++i) {
      if (repeaterMatch(repeatElems[i].getAttribute(attr), repeater, exact)) {
        var elem = repeatElems[i];
        var row = [];
        while (elem.nodeType != 8 ||
            !repeaterMatch(elem.nodeValue, repeater)) {
          if (elem.nodeType == 1) {
            row.push(elem);
          }
          elem = elem.nextSibling;
        }
        multiRows.push(row);
      }
    }
  }
  var row = rows[index] || [], multiRow = multiRows[index] || [];
  return [].concat(row, multiRow);
}
function findRepeaterRows ( repeater , exact , index , using ) { using = using || document ; var prefixes = [ 'ng-' , 'ng_' , 'data-ng-' , 'x-ng-' , 'ng\\:' ] ; var rows = [ ] ; for ( var p = 0 ; p < prefixes . length ; ++ p ) { var attr = prefixes [ p ] + 'repeat' ; var repeatElems = using . querySelectorAll ( '[' + attr + ']' ) ; attr = attr . replace ( / \\ / g , '' ) ; for ( var i = 0 ; i < repeatElems . length ; ++ i ) { if ( repeaterMatch ( repeatElems [ i ] . getAttribute ( attr ) , repeater , exact ) ) { rows . push ( repeatElems [ i ] ) ; } } } /* multiRows is an array of arrays, where each inner array contains
     one row of elements. */ var multiRows = [ ] ; for ( var p = 0 ; p < prefixes . length ; ++ p ) { var attr = prefixes [ p ] + 'repeat-start' ; var repeatElems = using . querySelectorAll ( '[' + attr + ']' ) ; attr = attr . replace ( / \\ / g , '' ) ; for ( var i = 0 ; i < repeatElems . length ; ++ i ) { if ( repeaterMatch ( repeatElems [ i ] . getAttribute ( attr ) , repeater , exact ) ) { var elem = repeatElems [ i ] ; var row = [ ] ; while ( elem . nodeType != 8 || ! repeaterMatch ( elem . nodeValue , repeater ) ) { if ( elem . nodeType == 1 ) { row . push ( elem ) ; } elem = elem . nextSibling ; } multiRows . push ( row ) ; } } } var row = rows [ index ] || [ ] , multiRow = multiRows [ index ] || [ ] ; return [ ] . concat ( row , multiRow ) ; }
Find an array of elements matching a row within an ng-repeat.
Always returns an array of only one element for plain old ng-repeat.
Returns an array of all the elements in one segment for ng-repeat-start.

@param {string} repeater The text of the repeater, e.g. 'cat in cats'.
@param {boolean} exact Whether the repeater needs to be matched exactly
@param {number} index The row index.
@param {Element} using The scope of the search.

@return {Array.<Element>} The row of the repeater, or an array of elements
in the first row in the case of ng-repeat-start.
Find an array of elements matching a row within an ng - repeat . Always returns an array of only one element for plain old ng - repeat . Returns an array of all the elements in one segment for ng - repeat - start .