1
1
part of angular.core.dom_internal;
2
2
3
-
4
3
class TemplateElementBinder extends ElementBinder {
5
4
final DirectiveRef template;
6
5
ViewFactory templateViewFactory;
@@ -15,17 +14,20 @@ class TemplateElementBinder extends ElementBinder {
15
14
return _directiveCache = [template];
16
15
}
17
16
18
- TemplateElementBinder (_perf, _expando, this .template, this .templateBinder, onEvents, childMode)
17
+ TemplateElementBinder (_perf, _expando, this .template, this .templateBinder,
18
+ onEvents, childMode)
19
19
: super (_perf, _expando, null , null , onEvents, childMode);
20
20
21
- toString () => "[TemplateElementBinder template:$template ]" ;
21
+ String toString () => "[TemplateElementBinder template:$template ]" ;
22
22
23
23
_registerViewFactory (node, parentInjector, nodeModule) {
24
24
assert (templateViewFactory != null );
25
25
nodeModule
26
- ..factory (ViewPort , (_) => new ViewPort (node, parentInjector.get (NgAnimate )))
26
+ ..factory (ViewPort , (_) =>
27
+ new ViewPort (node, parentInjector.get (NgAnimate )))
27
28
..value (ViewFactory , templateViewFactory)
28
- ..factory (BoundViewFactory , (Injector injector) => templateViewFactory.bind (injector));
29
+ ..factory (BoundViewFactory , (Injector injector) =>
30
+ templateViewFactory.bind (injector));
29
31
}
30
32
}
31
33
@@ -35,15 +37,13 @@ class TemplateElementBinder extends ElementBinder {
35
37
*/
36
38
class ElementBinder {
37
39
// DI Services
38
-
39
40
final Profiler _perf;
40
41
final Expando _expando;
41
42
final Map onEvents;
42
43
43
44
// Member fields
44
45
final decorators;
45
46
46
-
47
47
final DirectiveRef component;
48
48
49
49
// Can be either COMPILE_CHILDREN or IGNORE_CHILDREN
@@ -83,12 +83,9 @@ class ElementBinder {
83
83
84
84
var attachDelayStatus = controller is NgAttachAware ? [false ] : null ;
85
85
checkAttachReady () {
86
- // TODO .every may be a better choice.
87
- if (attachDelayStatus.reduce ((a, b) => a && b)) {
86
+ if (attachDelayStatus.every ((a) => a)) {
88
87
attachDelayStatus = null ;
89
- if (scope.isAttached) {
90
- controller.attach ();
91
- }
88
+ if (scope.isAttached) controller.attach ();
92
89
}
93
90
}
94
91
for (var map in ref.mappings) {
@@ -174,10 +171,9 @@ class ElementBinder {
174
171
175
172
// Overridden in TemplateElementBinder
176
173
_registerViewFactory (node, parentInjector, nodeModule) {
177
- nodeModule
178
- ..factory (ViewPort , null )
179
- ..factory (ViewFactory , null )
180
- ..factory (BoundViewFactory , null );
174
+ nodeModule..factory (ViewPort , null )
175
+ ..factory (ViewFactory , null )
176
+ ..factory (BoundViewFactory , null );
181
177
}
182
178
183
179
Injector bind (View view, Injector parentInjector, dom.Node node) {
@@ -234,7 +230,7 @@ class ElementBinder {
234
230
return nodeInjector;
235
231
}
236
232
237
- toString () => "[ElementBinder decorators:$decorators ]" ;
233
+ String toString () => "[ElementBinder decorators:$decorators ]" ;
238
234
}
239
235
240
236
// Used for walking the DOM
@@ -244,15 +240,16 @@ class ElementBinderTreeRef {
244
240
245
241
ElementBinderTreeRef (this .offsetIndex, this .subtree);
246
242
}
243
+
247
244
class ElementBinderTree {
248
- ElementBinder binder;
249
- List <ElementBinderTreeRef > subtrees;
245
+ final ElementBinder binder;
246
+ final List <ElementBinderTreeRef > subtrees;
250
247
251
248
ElementBinderTree (this .binder, this .subtrees);
252
249
}
253
250
254
251
class TaggedTextBinder {
255
- ElementBinder binder;
252
+ final ElementBinder binder;
256
253
final int offsetIndex;
257
254
258
255
TaggedTextBinder (this .binder, this .offsetIndex);
0 commit comments