Skip to content

Commit 983c00c

Browse files
docs(di/src/annotations): use triple backticks to code-fence code blocks
1 parent 11c52ce commit 983c00c

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

modules/di/src/annotations.js

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import {CONST} from "facade/lang";
33
/**
44
* A parameter annotation that creates a synchronous eager dependency.
55
*
6-
* class AComponent {
7-
* constructor(@Inject('aServiceToken') aService) {}
8-
* }
6+
* ```
7+
* class AComponent {
8+
* constructor(@Inject('aServiceToken') aService) {}
9+
* }
10+
* ```
911
*
1012
*/
1113
export class Inject {
@@ -19,11 +21,13 @@ export class Inject {
1921
/**
2022
* A parameter annotation that creates an asynchronous eager dependency.
2123
*
22-
* class AComponent {
23-
* constructor(@InjectPromise('aServiceToken') aServicePromise) {
24-
* aServicePromise.then(aService => ...);
25-
* }
26-
* }
24+
* ```
25+
* class AComponent {
26+
* constructor(@InjectPromise('aServiceToken') aServicePromise) {
27+
* aServicePromise.then(aService => ...);
28+
* }
29+
* }
30+
* ```
2731
*
2832
*/
2933
export class InjectPromise {
@@ -37,11 +41,13 @@ export class InjectPromise {
3741
/**
3842
* A parameter annotation that creates a synchronous lazy dependency.
3943
*
40-
* class AComponent {
41-
* constructor(@InjectLazy('aServiceToken') aServiceFn) {
42-
* aService = aServiceFn();
43-
* }
44-
* }
44+
* ```
45+
* class AComponent {
46+
* constructor(@InjectLazy('aServiceToken') aServiceFn) {
47+
* aService = aServiceFn();
48+
* }
49+
* }
50+
* ```
4551
*
4652
*/
4753
export class InjectLazy {
@@ -60,16 +66,20 @@ export class InjectLazy {
6066
*
6167
* For example:
6268
*
63-
* class Parent extends DependencyAnnotation {}
64-
* class NotDependencyProperty {}
69+
* ```
70+
* class Parent extends DependencyAnnotation {}
71+
* class NotDependencyProperty {}
6572
*
66-
* class AComponent {
67-
* constructor(@Parent @NotDependencyProperty aService:AService) {}
68-
* }
73+
* class AComponent {
74+
* constructor(@Parent @NotDependencyProperty aService:AService) {}
75+
* }
76+
* ```
6977
*
7078
* will create the following dependency:
7179
*
72-
* new Dependency(Key.get(AService), [new Parent()])
80+
* ```
81+
* new Dependency(Key.get(AService), [new Parent()])
82+
* ```
7383
*
7484
* The framework can use `new Parent()` to handle the `aService` dependency
7585
* in a specific way.

0 commit comments

Comments
 (0)