mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-25 14:23:43 +00:00
chore($compile): remove special case for ngIf and ngRepeat
This commit is contained in:
parent
6578bd0c82
commit
5b620653f6
3 changed files with 6 additions and 3 deletions
|
|
@ -1173,9 +1173,10 @@ function $CompileProvider($provide) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (directiveValue = directive.transclude) {
|
if (directiveValue = directive.transclude) {
|
||||||
// Special case ngRepeat so that we don't complain about duplicate transclusion, ngRepeat
|
// Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
|
||||||
// knows how to handle this on its own.
|
// This option should only be used by directives that know how to how to safely handle element transclusion,
|
||||||
if (directiveName !== 'ngRepeat' && directiveName !== 'ngIf') {
|
// where the transcluded nodes are added or replaced after linking.
|
||||||
|
if (!directive.$$tlb) {
|
||||||
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
|
assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);
|
||||||
transcludeDirective = directive;
|
transcludeDirective = directive;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ var ngIfDirective = ['$animate', function($animate) {
|
||||||
priority: 600,
|
priority: 600,
|
||||||
terminal: true,
|
terminal: true,
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
|
$$tlb: true,
|
||||||
compile: function (element, attr, transclude) {
|
compile: function (element, attr, transclude) {
|
||||||
return function ($scope, $element, $attr) {
|
return function ($scope, $element, $attr) {
|
||||||
var block = {}, childScope;
|
var block = {}, childScope;
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
|
||||||
transclude: 'element',
|
transclude: 'element',
|
||||||
priority: 1000,
|
priority: 1000,
|
||||||
terminal: true,
|
terminal: true,
|
||||||
|
$$tlb: true,
|
||||||
compile: function(element, attr, linker) {
|
compile: function(element, attr, linker) {
|
||||||
return function($scope, $element, $attr){
|
return function($scope, $element, $attr){
|
||||||
var expression = $attr.ngRepeat;
|
var expression = $attr.ngRepeat;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue