diff options
| author | Brian Ford | 2013-10-30 14:51:02 -0700 | 
|---|---|---|
| committer | Brian Ford | 2013-10-30 16:21:02 -0700 | 
| commit | e19067c9bbac3c3bb450c80f73eb5518bd0db1a1 (patch) | |
| tree | e4e0220a67c2d0c57077ecdd4eedfd85e81c2b3a /src/ng/compile.js | |
| parent | 9d0a69772c39bfc751ca2000c3b4b3381e51fe93 (diff) | |
| download | angular.js-e19067c9bbac3c3bb450c80f73eb5518bd0db1a1.tar.bz2 | |
fix(ngIf): ngIf removes elements dynamically added to it
When using ngIf with ngInclude on the same element, ngIf previously did not remove
elements added by ngInclude. Similarly, when using ngIfStart/End, ngIf will miss
elements added between the start/end markers added after ngIf is linked.
This commit changes the behavior of ngIf to add a comment node at the end of its
elements such that elements between the starting comment and this ending comment
are removed when ngIf's predicate does not hold.
Diffstat (limited to 'src/ng/compile.js')
| -rw-r--r-- | src/ng/compile.js | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/ng/compile.js b/src/ng/compile.js index 7754a8e6..af7d5e6b 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1175,7 +1175,7 @@ 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') { +          if (directiveName !== 'ngRepeat' && directiveName !== 'ngIf') {              assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode);              transcludeDirective = directive;            } | 
