Skip to content

Commit 81c39c6

Browse files
anicolastoddmotto
authored andcommitted
Fix directive declaration example (toddmotto#167)
When directive is declared with an arrow function, injected parameters must be provided as arguments of the arrow function, then forwarded to the directive constructor.
1 parent 3bf5057 commit 81c39c6

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ import './todo.scss';
653653
export const TodoModule = angular
654654
.module('todo', [])
655655
.component('todo', TodoComponent)
656-
.directive('todoAutofocus', () => new TodoAutoFocus())
656+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
657657
.name;
658658
```
659659

i18n/es.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ import TodoAutofocus from './todo-autofocus.directive';
653653
const TodoModule = angular
654654
.module('todo', [])
655655
.component('todo', TodoComponent)
656-
.directive('todoAutofocus', () => new TodoAutoFocus)
656+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
657657
.name;
658658

659659
export default TodoModule;

i18n/fr-fr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ import './todo.scss';
609609
export const TodoModule = angular
610610
.module('todo', [])
611611
.component('todo', TodoComponent)
612-
.directive('todoAutofocus', () => new TodoAutoFocus)
612+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
613613
.name;
614614
```
615615

i18n/id.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ import TodoAutofocus from './todo-autofocus.directive';
671671
const TodoModule = angular
672672
.module('todo', [])
673673
.component('todo', TodoComponent)
674-
.directive('todoAutofocus', () => new TodoAutoFocus)
674+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
675675
.name;
676676

677677
export default TodoModule;

i18n/it-it.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ import './todo.scss';
673673
export const TodoModule = angular
674674
.module('todo', [])
675675
.component('todo', TodoComponent)
676-
.directive('todoAutofocus', () => new TodoAutoFocus())
676+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
677677
.name;
678678
```
679679

i18n/pt-pt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ import TodoAutofocus from './todo-autofocus.directive';
671671
const TodoModule = angular
672672
.module('todo', [])
673673
.component('todo', TodoComponent)
674-
.directive('todoAutofocus', () => new TodoAutoFocus)
674+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
675675
.name;
676676

677677
export default TodoModule;

i18n/ru-ru.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ import TodoAutofocus from './todo-autofocus.directive';
671671
const TodoModule = angular
672672
.module('todo', [])
673673
.component('todo', TodoComponent)
674-
.directive('todoAutofocus', () => new TodoAutoFocus)
674+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
675675
.name;
676676

677677
export default TodoModule;

i18n/zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ import TodoAutofocus from './todo-autofocus.directive';
688688
const TodoModule = angular
689689
.module('todo', [])
690690
.component('todo', TodoComponent)
691-
.directive('todoAutofocus', () => new TodoAutoFocus)
691+
.directive('todoAutofocus', ($timeout) => new TodoAutoFocus($timeout))
692692
.name;
693693

694694
export default TodoModule;

typescript/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ import { TodoAutofocus } from './todo-autofocus.directive';
697697
export const TodoModule = angular
698698
.module('todo', [])
699699
.component('todo', TodoComponent)
700-
.directive('todoAutofocus', () => new TodoAutoFocus)
700+
.directive('todoAutofocus', ($timeout: angular.ITimeoutService) => new TodoAutoFocus($timeout))
701701
.name;
702702

703703
```

0 commit comments

Comments
 (0)