@@ -124,7 +124,7 @@ class ElementBinder {
124
124
dstPathFn.assign (controller, _parser (expression).bind (scope.context, ScopeLocals .wrapper));
125
125
}
126
126
127
- _createAttrMappings (controller , scope, List <MappingParts > mappings, nodeAttrs, formatters, tasks) {
127
+ _createAttrMappings (directive , scope, List <MappingParts > mappings, nodeAttrs, formatters, tasks) {
128
128
mappings.forEach ((MappingParts p) {
129
129
var attrName = p.attrName;
130
130
var dstExpression = p.dstExpression;
@@ -140,11 +140,11 @@ class ElementBinder {
140
140
if (bindAttr != null ) {
141
141
if (p.mode == '<=>' ) {
142
142
_bindTwoWay (tasks, bindAttr, scope, dstPathFn,
143
- controller , formatters, dstExpression);
143
+ directive , formatters, dstExpression);
144
144
} else if (p.mode == '&' ) {
145
- _bindCallback (dstPathFn, controller , bindAttr, scope);
145
+ _bindCallback (dstPathFn, directive , bindAttr, scope);
146
146
} else {
147
- _bindOneWay (tasks, bindAttr, scope, dstPathFn, controller , formatters);
147
+ _bindOneWay (tasks, bindAttr, scope, dstPathFn, directive , formatters);
148
148
}
149
149
return ;
150
150
}
@@ -153,7 +153,7 @@ class ElementBinder {
153
153
case '@' : // string
154
154
var taskId = tasks.registerTask ();
155
155
nodeAttrs.observe (attrName, (value) {
156
- dstPathFn.assign (controller , value);
156
+ dstPathFn.assign (directive , value);
157
157
tasks.completeTask (taskId);
158
158
});
159
159
break ;
@@ -162,13 +162,13 @@ class ElementBinder {
162
162
if (nodeAttrs[attrName] == null ) return ;
163
163
164
164
_bindTwoWay (tasks, nodeAttrs[attrName], scope, dstPathFn,
165
- controller , formatters, dstExpression);
165
+ directive , formatters, dstExpression);
166
166
break ;
167
167
168
168
case '=>' : // one-way
169
169
if (nodeAttrs[attrName] == null ) return ;
170
170
_bindOneWay (tasks, nodeAttrs[attrName], scope,
171
- dstPathFn, controller , formatters);
171
+ dstPathFn, directive , formatters);
172
172
break ;
173
173
174
174
case '=>!' : // one-way, one-time
@@ -178,7 +178,7 @@ class ElementBinder {
178
178
var watch;
179
179
var lastOneTimeValue;
180
180
watch = scope.watch (nodeAttrs[attrName], (value, _) {
181
- if ((lastOneTimeValue = dstPathFn.assign (controller , value)) != null && watch != null ) {
181
+ if ((lastOneTimeValue = dstPathFn.assign (directive , value)) != null && watch != null ) {
182
182
var watchToRemove = watch;
183
183
watch = null ;
184
184
scope.rootScope.domWrite (() {
@@ -193,7 +193,7 @@ class ElementBinder {
193
193
break ;
194
194
195
195
case '&' : // callback
196
- _bindCallback (dstPathFn, controller , nodeAttrs[attrName], scope);
196
+ _bindCallback (dstPathFn, directive , nodeAttrs[attrName], scope);
197
197
break ;
198
198
}
199
199
});
@@ -205,24 +205,24 @@ class ElementBinder {
205
205
try {
206
206
var linkMapTimer;
207
207
assert ((linkTimer = _perf.startTimer ('ng.view.link' , ref.type)) != false );
208
- var controller = nodeInjector.get (ref.type);
209
- probe.directives.add (controller );
208
+ var directive = nodeInjector.get (ref.type);
209
+ probe.directives.add (directive );
210
210
assert ((linkMapTimer = _perf.startTimer ('ng.view.link.map' , ref.type)) != false );
211
211
212
212
if (ref.annotation is Controller ) {
213
- scope.context[(ref.annotation as Controller ).publishAs] = controller ;
213
+ scope.context[(ref.annotation as Controller ).publishAs] = directive ;
214
214
}
215
215
216
- var tasks = new _TaskList (controller is AttachAware ? () {
217
- if (scope.isAttached) controller .attach ();
216
+ var tasks = new _TaskList (directive is AttachAware ? () {
217
+ if (scope.isAttached) directive .attach ();
218
218
} : null );
219
219
220
220
if (ref.mappings.isNotEmpty) {
221
221
if (nodeAttrs == null ) nodeAttrs = new _AnchorAttrs (ref);
222
- _createAttrMappings (controller , scope, ref.mappings, nodeAttrs, formatters, tasks);
222
+ _createAttrMappings (directive , scope, ref.mappings, nodeAttrs, formatters, tasks);
223
223
}
224
224
225
- if (controller is AttachAware ) {
225
+ if (directive is AttachAware ) {
226
226
var taskId = tasks.registerTask ();
227
227
Watch watch;
228
228
watch = scope.watch ('1' , // Cheat a bit.
@@ -234,8 +234,8 @@ class ElementBinder {
234
234
235
235
tasks.doneRegistering ();
236
236
237
- if (controller is DetachAware ) {
238
- scope.on (ScopeEvent .DESTROY ).listen ((_) => controller .detach ());
237
+ if (directive is DetachAware ) {
238
+ scope.on (ScopeEvent .DESTROY ).listen ((_) => directive .detach ());
239
239
}
240
240
241
241
assert (_perf.stopTimer (linkMapTimer) != false );
0 commit comments