@@ -323,6 +323,7 @@ void main() {
323
323
..bind (LogElementComponent )
324
324
..bind (SayHelloFormatter )
325
325
..bind (OneTimeDecorator )
326
+ ..bind (OnceInside )
326
327
..bind (OuterShadowless )
327
328
..bind (InnerShadowy );
328
329
});
@@ -465,6 +466,22 @@ void main() {
465
466
expect (element).toHaveText ('inside ' );
466
467
}));
467
468
469
+ it ('should not pass null to a inner directives' , async ((Logger logger) {
470
+ _.compile ('<div>'
471
+ '<once-inside ng-repeat="x in nn" v="b"></once-inside>'
472
+ '</div>' );
473
+
474
+ _.rootScope.context['nn' ] = [1 ];
475
+ _.rootScope.apply ();
476
+ microLeap ();
477
+
478
+ _.rootScope.context['nn' ].add (2 );
479
+ _.rootScope.apply ();
480
+ microLeap ();
481
+
482
+ expect (logger.contains (null )).toBeFalsy ();
483
+ }));
484
+
468
485
it ('should create a component with I/O' , async (() {
469
486
_.compile (r'<div><io attr="A" expr="name" ondone="done=true"></io></div>' );
470
487
microLeap ();
@@ -880,6 +897,8 @@ void main() {
880
897
_.rootScope.apply ();
881
898
expect (logger).toEqual ([1 , null , 8 ]);
882
899
});
900
+
901
+
883
902
});
884
903
});
885
904
@@ -1520,3 +1539,17 @@ class OuterShadowless {}
1520
1539
selector: 'inner-shadowy' ,
1521
1540
template: '<content></content>' )
1522
1541
class InnerShadowy {}
1542
+
1543
+ @Component (
1544
+ selector: 'once-inside' ,
1545
+ template: '<div one-time="ctrl.ot"></div>' ,
1546
+ publishAs: 'ctrl'
1547
+ )
1548
+ class OnceInside {
1549
+ var ot;
1550
+
1551
+ Logger log;
1552
+ @NgAttr ("v" )
1553
+ set v (x) { log (x); ot = "($x )" ; }
1554
+ OnceInside (Logger this .log) { log ('!' ); }
1555
+ }
0 commit comments