Skip to content

Commit 167279d

Browse files
adiman9toddmotto
authored andcommitted
fix: Missing argument in autofocus Directive Class (toddmotto#118)
further additions to constructor Changed constructor code in translations
1 parent 064fb43 commit 167279d

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,16 @@ Or using ES2015 `Class` (note manually calling `new TodoAutoFocus` when register
647647
import angular from 'angular';
648648

649649
class TodoAutoFocus {
650-
constructor() {
650+
constructor($timeout) {
651651
this.restrict = 'A';
652+
this.$timeout = $timeout;
652653
}
653654
link($scope, $element, $attrs) {
654655
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
655656
if (!newValue) {
656657
return;
657658
}
658-
$timeout(() => $element[0].focus());
659+
this.$timeout(() => $element[0].focus());
659660
});
660661
}
661662
}

i18n/es.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,19 @@ O utilizando una clases ES2015 (toma en cuenta la llamada manual de `new TodoAut
619619
import angular from '../../angular';
620620

621621
class TodoAutoFocus {
622-
constructor() {
622+
constructor($timeout) {
623623
this.restrict = 'A';
624+
this.$timeout = $timeout;
624625
}
625626
link($scope, $element, $attrs) {
626627
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
627628
if (!newValue) {
628629
return;
629630
}
630-
$timeout(() => $element[0].focus());
631+
this.$timeout(() => $element[0].focus());
631632
});
632633
}
633-
});
634+
}
634635

635636
TodoAutoFocus.$inject = ['$timeout'];
636637

i18n/fr-fr.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -642,15 +642,16 @@ Ou en utilisant les `Class` d'ES2015 (notez qu'appeler manuellement `new TodoAut
642642
import angular from 'angular';
643643

644644
class TodoAutoFocus {
645-
constructor() {
645+
constructor($timeout) {
646646
this.restrict = 'A';
647+
this.$timeout = $timeout;
647648
}
648649
link($scope, $element, $attrs) {
649650
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
650651
if (!newValue) {
651652
return;
652653
}
653-
$timeout(() => $element[0].focus());
654+
this.$timeout(() => $element[0].focus());
654655
});
655656
}
656657
}

i18n/id.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -641,15 +641,16 @@ Atau menggunakan `Class` ES2015 (catat pemanggilan `new TodoAutoFocus` secara ma
641641
import angular from 'angular';
642642

643643
class TodoAutoFocus {
644-
constructor() {
644+
constructor($timeout) {
645645
this.restrict = 'A';
646+
this.$timeout = $timeout;
646647
}
647648
link($scope, $element, $attrs) {
648649
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
649650
if (!newValue) {
650651
return;
651652
}
652-
$timeout(() => $element[0].focus());
653+
this.$timeout(() => $element[0].focus());
653654
});
654655
}
655656
}

i18n/pt-pt.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -639,18 +639,19 @@ Ou utilizando ES2015 `Class` (de notar a chamada manual de `new TodoAutoFocus` a
639639
import angular from 'angular';
640640

641641
class TodoAutoFocus {
642-
constructor() {
642+
constructor($timeout) {
643643
this.restrict = 'A';
644+
this.$timeout = $timeout;
644645
}
645646
link($scope, $element, $attrs) {
646647
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
647648
if (!newValue) {
648649
return;
649650
}
650-
$timeout(() => $element[0].focus());
651+
this.$timeout(() => $element[0].focus());
651652
});
652653
}
653-
});
654+
}
654655

655656
TodoAutoFocus.$inject = ['$timeout'];
656657

i18n/ru-ru.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -641,15 +641,16 @@ export default todo;
641641
import angular from 'angular';
642642

643643
class TodoAutoFocus {
644-
constructor() {
644+
constructor($timeout) {
645645
this.restrict = 'A';
646+
this.$timeout = $timeout;
646647
}
647648
link($scope, $element, $attrs) {
648649
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
649650
if (!newValue) {
650651
return;
651652
}
652-
$timeout(() => $element[0].focus());
653+
this.$timeout(() => $element[0].focus());
653654
});
654655
}
655656
}

i18n/zh-cn.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -656,15 +656,16 @@ export default todo;
656656
import angular from 'angular';
657657

658658
class TodoAutoFocus {
659-
constructor() {
659+
constructor($timeout) {
660660
this.restrict = 'A';
661+
this.$timeout = $timeout;
661662
}
662663
link($scope, $element, $attrs) {
663664
$scope.$watch($attrs.todoAutofocus, (newValue, oldValue) => {
664665
if (!newValue) {
665666
return;
666667
}
667-
$timeout(() => $element[0].focus());
668+
this.$timeout(() => $element[0].focus());
668669
});
669670
}
670671
}

0 commit comments

Comments
 (0)