Skip to content

Commit

Permalink
chore($compile): remove special case for ngIf and ngRepeat
Browse files Browse the repository at this point in the history
  • Loading branch information
btford committed Oct 30, 2013
1 parent 6578bd0 commit 5b62065
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/ng/directive/ngIf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/ng/directive/ngRepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b62065

Please sign in to comment.