This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ class Block implements ElementWrapper {
87
87
if (directiveRefs == null || directiveRefs.length == 0 ) return parentInjector;
88
88
var nodeModule = new Module ();
89
89
var blockHoleFactory = () => null ;
90
+ var blockFactory = () => null ;
90
91
var boundBlockFactory = () => null ;
91
92
var nodeAttrs = new NodeAttrs (node);
92
93
@@ -118,11 +119,13 @@ class Block implements ElementWrapper {
118
119
}
119
120
nodeAttrs[ref.directive.$name] = ref.value;
120
121
if (ref.directive.isStructural) {
121
- blockHoleFactory = (Injector injector) => new BlockHole ([node]);
122
+ blockHoleFactory = () => new BlockHole ([node]);
123
+ blockFactory = () => ref.blockFactory;
122
124
boundBlockFactory = (Injector injector) => ref.blockFactory.bind (injector);
123
125
}
124
126
});
125
127
nodeModule.factory (BlockHole , blockHoleFactory);
128
+ nodeModule.factory (BlockFactory , blockFactory);
126
129
nodeModule.factory (BoundBlockFactory , boundBlockFactory);
127
130
var nodeInjector = parentInjector.createChild ([nodeModule]);
128
131
directiveRefs.forEach ((ref) => nodeInjector.get (ref.directive.type));
Original file line number Diff line number Diff line change @@ -2,12 +2,20 @@ import "_specs.dart";
2
2
3
3
@NgDirective (transclude: true , selector: 'foo' )
4
4
class LoggerBlockDirective {
5
- LoggerBlockDirective (BlockHole hole, BoundBlockFactory boundBlockFactory, Logger logger) {
5
+ LoggerBlockDirective (BlockHole hole, BlockFactory blockFactory,
6
+ BoundBlockFactory boundBlockFactory, Logger logger) {
6
7
if (hole == null ) {
7
8
throw new ArgumentError ('BlockHole must be injected.' );
8
9
}
10
+ if (boundBlockFactory == null ) {
11
+ throw new ArgumentError ('BoundBlockFactory must be injected.' );
12
+ }
13
+ if (blockFactory == null ) {
14
+ throw new ArgumentError ('BlockFactory must be injected.' );
15
+ }
9
16
logger.add (hole);
10
17
logger.add (boundBlockFactory);
18
+ logger.add (blockFactory);
11
19
}
12
20
}
13
21
You can’t perform that action at this time.
0 commit comments