From a967987a1733b95ddff2a093882c45ab332da091 Mon Sep 17 00:00:00 2001 From: Thanos Korakas Date: Thu, 10 Mar 2016 23:35:16 +0200 Subject: [PATCH] docs(guide/Components): ctrl instead of this --- docs/content/guide/component.ngdoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/content/guide/component.ngdoc b/docs/content/guide/component.ngdoc index 21ed9a6ef5e1..293a6864d1be 100644 --- a/docs/content/guide/component.ngdoc +++ b/docs/content/guide/component.ngdoc @@ -230,9 +230,9 @@ it upwards to the heroList component, which updates the original data. function EditableFieldController($scope, $element, $attrs) { var ctrl = this; - this.editMode = false; + ctrl.editMode = false; - this.handleModeChange = function() { + ctrl.handleModeChange = function() { if (ctrl.editMode) { ctrl.onUpdate({value: ctrl.fieldValue}); ctrl.fieldValueCopy = ctrl.fieldValue; @@ -240,17 +240,17 @@ it upwards to the heroList component, which updates the original data. ctrl.editMode = !ctrl.editMode; }; - this.reset = function() { + ctrl.reset = function() { ctrl.fieldValue = ctrl.fieldValueCopy; }; - this.$onInit = function() { + ctrl.$onInit = function() { // Make a copy of the initial value to be able to reset it later - this.fieldValueCopy = this.fieldValue; + ctrl.fieldValueCopy = ctrl.fieldValue; // Set a default fieldType - if (!this.fieldType) { - this.fieldType = 'text'; + if (!ctrl.fieldType) { + ctrl.fieldType = 'text'; } }; }