This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree 2 files changed +28
-1
lines changed 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ class ContentPort {
52
52
53
53
var next;
54
54
for (next = _beginComment.nextNode;
55
- next.nodeType != dom.Node .COMMENT_NODE && next.text != endCommentText;
55
+ next.nodeType != dom.Node .COMMENT_NODE || next.text != endCommentText;
56
56
next = _beginComment.nextNode) {
57
57
_childNodes.add (next);
58
58
next.remove ();
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ forBothCompilers(fn) {
19
19
});
20
20
fn ();
21
21
});
22
+ }
23
+
24
+ forAllCompilersAndComponentFactories (fn) {
25
+ forBothCompilers (fn);
22
26
23
27
describe ('transcluding components' , () {
24
28
beforeEachModule ((Module m) {
@@ -33,6 +37,29 @@ forBothCompilers(fn) {
33
37
34
38
void main () {
35
39
forBothCompilers (() =>
40
+ describe ('TranscludingComponentFactory' , () {
41
+ TestBed _;
42
+
43
+ beforeEachModule ((Module m) {
44
+ return m
45
+ ..bind (ComponentFactory , toImplementation: TranscludingComponentFactory )
46
+ ..bind (SimpleComponent );
47
+ });
48
+
49
+ beforeEach (inject ((TestBed tb) => _ = tb));
50
+
51
+ it ('should correctly detach transcluded content when scope destroyed' , async (() {
52
+ var scope = _.rootScope.createChild ({});
53
+ var element = _.compile (r'<div><simple><span ng-if="true == true">trans</span></simple></div>' , scope: scope);
54
+ microLeap ();
55
+ _.rootScope.apply ();
56
+ expect (element).toHaveText ('INNER(trans)' );
57
+ scope.destroy ();
58
+ expect (element).toHaveText ('INNER()' );
59
+ }));
60
+ }));
61
+
62
+ forAllCompilersAndComponentFactories (() =>
36
63
describe ('dte.compiler' , () {
37
64
TestBed _;
38
65
You can’t perform that action at this time.
0 commit comments