Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 09d3172

Browse files
committed
Merge pull request #109 from angular-ui/fix-attrloop
fix(child-directives): prevent loop in case directives compiled as attribute
2 parents 468b3be + df8d3cb commit 09d3172

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/select.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,14 @@
502502
var transcluded = angular.element('<div>').append(clone);
503503

504504
var transcludedMatch = transcluded.querySelectorAll('.ui-select-match');
505+
transcludedMatch.removeAttr('ui-select-match'); //To avoid loop in case directive as attr
505506
if (transcludedMatch.length !== 1) {
506507
throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-match but got '{0}'.", transcludedMatch.length);
507508
}
508509
element.querySelectorAll('.ui-select-match').replaceWith(transcludedMatch);
509510

510511
var transcludedChoices = transcluded.querySelectorAll('.ui-select-choices');
512+
transcludedChoices.removeAttr('ui-select-choices'); //To avoid loop in case directive as attr
511513
if (transcludedChoices.length !== 1) {
512514
throw uiSelectMinErr('transcluded', "Expected 1 .ui-select-choices but got '{0}'.", transcludedChoices.length);
513515
}

0 commit comments

Comments
 (0)