aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Ford2013-10-30 15:02:25 -0700
committerBrian Ford2013-10-30 16:21:02 -0700
commit5b620653f61ae3d9f1de8346de271752fa12f26f (patch)
treec4d8c5b91363fdbf76b143d7f7f67c2f45d3808a /src
parent6578bd0c82b5cbb0cd6f6fea0787fb7ce820d4e7 (diff)
downloadangular.js-5b620653f61ae3d9f1de8346de271752fa12f26f.tar.bz2
chore($compile): remove special case for ngIf and ngRepeat
Diffstat (limited to 'src')
-rw-r--r--src/ng/compile.js7
-rw-r--r--src/ng/directive/ngIf.js1
-rw-r--r--src/ng/directive/ngRepeat.js1
3 files changed, 6 insertions, 3 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index af7d5e6b..d3ade6b8 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -1173,9 +1173,10 @@ function $CompileProvider($provide) {
}
if (directiveValue = directive.transclude) {
- // Special case ngRepeat so that we don't complain about duplicate transclusion, ngRepeat
- // knows how to handle this on its own.
- if (directiveName !== 'ngRepeat' && directiveName !== 'ngIf') {
+ // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
+ // This option should only be used by directives that know how to how to safely handle element transclusion,
+ // where the transcluded nodes are added or replaced after linking.
+ if (!directive.$$tlb) {
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
transcludeDirective = directive;
}
diff --git a/src/ng/directive/ngIf.js b/src/ng/directive/ngIf.js
index 3f56449f..35c122ad 100644
--- a/src/ng/directive/ngIf.js
+++ b/src/ng/directive/ngIf.js
@@ -84,6 +84,7 @@ var ngIfDirective = ['$animate', function($animate) {
priority: 600,
terminal: true,
restrict: 'A',
+ $$tlb: true,
compile: function (element, attr, transclude) {
return function ($scope, $element, $attr) {
var block = {}, childScope;
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js
index ee0faf23..9e5ad2f5 100644
--- a/src/ng/directive/ngRepeat.js
+++ b/src/ng/directive/ngRepeat.js
@@ -214,6 +214,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
transclude: 'element',
priority: 1000,
terminal: true,
+ $$tlb: true,
compile: function(element, attr, linker) {
return function($scope, $element, $attr){
var expression = $attr.ngRepeat;