Skip to content

Commit 0c2d398

Browse files
tkorakasgkalpak
authored andcommitted
docs(guide/component): use ctrl instead of this (for consistency)
Closes angular#14215
1 parent efd448d commit 0c2d398

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/content/guide/component.ngdoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -230,27 +230,27 @@ it upwards to the heroList component, which updates the original data.
230230

231231
function EditableFieldController($scope, $element, $attrs) {
232232
var ctrl = this;
233-
this.editMode = false;
233+
ctrl.editMode = false;
234234

235-
this.handleModeChange = function() {
235+
ctrl.handleModeChange = function() {
236236
if (ctrl.editMode) {
237237
ctrl.onUpdate({value: ctrl.fieldValue});
238238
ctrl.fieldValueCopy = ctrl.fieldValue;
239239
}
240240
ctrl.editMode = !ctrl.editMode;
241241
};
242242

243-
this.reset = function() {
243+
ctrl.reset = function() {
244244
ctrl.fieldValue = ctrl.fieldValueCopy;
245245
};
246246

247-
this.$onInit = function() {
247+
ctrl.$onInit = function() {
248248
// Make a copy of the initial value to be able to reset it later
249-
this.fieldValueCopy = this.fieldValue;
249+
ctrl.fieldValueCopy = ctrl.fieldValue;
250250

251251
// Set a default fieldType
252-
if (!this.fieldType) {
253-
this.fieldType = 'text';
252+
if (!ctrl.fieldType) {
253+
ctrl.fieldType = 'text';
254254
}
255255
};
256256
}

0 commit comments

Comments
 (0)