File tree 7 files changed +23
-16
lines changed
7 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -647,15 +647,16 @@ Or using ES2015 `Class` (note manually calling `new TodoAutoFocus` when register
647
647
import angular from ' angular' ;
648
648
649
649
class TodoAutoFocus {
650
- constructor () {
650
+ constructor ($timeout ) {
651
651
this .restrict = ' A' ;
652
+ this .$timeout = $timeout;
652
653
}
653
654
link ($scope , $element , $attrs ) {
654
655
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
655
656
if (! newValue) {
656
657
return ;
657
658
}
658
- $timeout (() => $element[0 ].focus ());
659
+ this . $timeout (() => $element[0 ].focus ());
659
660
});
660
661
}
661
662
}
Original file line number Diff line number Diff line change @@ -619,18 +619,19 @@ O utilizando una clases ES2015 (toma en cuenta la llamada manual de `new TodoAut
619
619
import angular from ' ../../angular' ;
620
620
621
621
class TodoAutoFocus {
622
- constructor () {
622
+ constructor ($timeout ) {
623
623
this .restrict = ' A' ;
624
+ this .$timeout = $timeout;
624
625
}
625
626
link ($scope , $element , $attrs ) {
626
627
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
627
628
if (! newValue) {
628
629
return ;
629
630
}
630
- $timeout (() => $element[0 ].focus ());
631
+ this . $timeout (() => $element[0 ].focus ());
631
632
});
632
633
}
633
- });
634
+ }
634
635
635
636
TodoAutoFocus .$inject = [' $timeout' ];
636
637
Original file line number Diff line number Diff line change @@ -642,15 +642,16 @@ Ou en utilisant les `Class` d'ES2015 (notez qu'appeler manuellement `new TodoAut
642
642
import angular from ' angular' ;
643
643
644
644
class TodoAutoFocus {
645
- constructor () {
645
+ constructor ($timeout ) {
646
646
this .restrict = ' A' ;
647
+ this .$timeout = $timeout;
647
648
}
648
649
link ($scope , $element , $attrs ) {
649
650
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
650
651
if (! newValue) {
651
652
return ;
652
653
}
653
- $timeout (() => $element[0 ].focus ());
654
+ this . $timeout (() => $element[0 ].focus ());
654
655
});
655
656
}
656
657
}
Original file line number Diff line number Diff line change @@ -641,15 +641,16 @@ Atau menggunakan `Class` ES2015 (catat pemanggilan `new TodoAutoFocus` secara ma
641
641
import angular from ' angular' ;
642
642
643
643
class TodoAutoFocus {
644
- constructor () {
644
+ constructor ($timeout ) {
645
645
this .restrict = ' A' ;
646
+ this .$timeout = $timeout;
646
647
}
647
648
link ($scope , $element , $attrs ) {
648
649
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
649
650
if (! newValue) {
650
651
return ;
651
652
}
652
- $timeout (() => $element[0 ].focus ());
653
+ this . $timeout (() => $element[0 ].focus ());
653
654
});
654
655
}
655
656
}
Original file line number Diff line number Diff line change @@ -639,18 +639,19 @@ Ou utilizando ES2015 `Class` (de notar a chamada manual de `new TodoAutoFocus` a
639
639
import angular from ' angular' ;
640
640
641
641
class TodoAutoFocus {
642
- constructor () {
642
+ constructor ($timeout ) {
643
643
this .restrict = ' A' ;
644
+ this .$timeout = $timeout;
644
645
}
645
646
link ($scope , $element , $attrs ) {
646
647
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
647
648
if (! newValue) {
648
649
return ;
649
650
}
650
- $timeout (() => $element[0 ].focus ());
651
+ this . $timeout (() => $element[0 ].focus ());
651
652
});
652
653
}
653
- });
654
+ }
654
655
655
656
TodoAutoFocus .$inject = [' $timeout' ];
656
657
Original file line number Diff line number Diff line change @@ -641,15 +641,16 @@ export default todo;
641
641
import angular from ' angular' ;
642
642
643
643
class TodoAutoFocus {
644
- constructor () {
644
+ constructor ($timeout ) {
645
645
this .restrict = ' A' ;
646
+ this .$timeout = $timeout;
646
647
}
647
648
link ($scope , $element , $attrs ) {
648
649
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
649
650
if (! newValue) {
650
651
return ;
651
652
}
652
- $timeout (() => $element[0 ].focus ());
653
+ this . $timeout (() => $element[0 ].focus ());
653
654
});
654
655
}
655
656
}
Original file line number Diff line number Diff line change @@ -656,15 +656,16 @@ export default todo;
656
656
import angular from ' angular' ;
657
657
658
658
class TodoAutoFocus {
659
- constructor () {
659
+ constructor ($timeout ) {
660
660
this .restrict = ' A' ;
661
+ this .$timeout = $timeout;
661
662
}
662
663
link ($scope , $element , $attrs ) {
663
664
$scope .$watch ($attrs .todoAutofocus , (newValue , oldValue ) => {
664
665
if (! newValue) {
665
666
return ;
666
667
}
667
- $timeout (() => $element[0 ].focus ());
668
+ this . $timeout (() => $element[0 ].focus ());
668
669
});
669
670
}
670
671
}
You can’t perform that action at this time.
0 commit comments