Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5b62065

Browse files
committed
chore($compile): remove special case for ngIf and ngRepeat
1 parent 6578bd0 commit 5b62065

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/ng/compile.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1173,9 +1173,10 @@ function $CompileProvider($provide) {
11731173
}
11741174

11751175
if (directiveValue = directive.transclude) {
1176-
// Special case ngRepeat so that we don't complain about duplicate transclusion, ngRepeat
1177-
// knows how to handle this on its own.
1178-
if (directiveName !== 'ngRepeat' && directiveName !== 'ngIf') {
1176+
// Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
1177+
// This option should only be used by directives that know how to how to safely handle element transclusion,
1178+
// where the transcluded nodes are added or replaced after linking.
1179+
if (!directive.$$tlb) {
11791180
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
11801181
transcludeDirective = directive;
11811182
}

src/ng/directive/ngIf.js

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ var ngIfDirective = ['$animate', function($animate) {
8484
priority: 600,
8585
terminal: true,
8686
restrict: 'A',
87+
$$tlb: true,
8788
compile: function (element, attr, transclude) {
8889
return function ($scope, $element, $attr) {
8990
var block = {}, childScope;

src/ng/directive/ngRepeat.js

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
214214
transclude: 'element',
215215
priority: 1000,
216216
terminal: true,
217+
$$tlb: true,
217218
compile: function(element, attr, linker) {
218219
return function($scope, $element, $attr){
219220
var expression = $attr.ngRepeat;

0 commit comments

Comments
 (0)