From 983c00c49512ba9656649810f9389563a2a3d9fa Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 4 Dec 2014 11:01:19 +0100 Subject: [PATCH] docs(di/src/annotations): use triple backticks to code-fence code blocks --- modules/di/src/annotations.js | 48 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/modules/di/src/annotations.js b/modules/di/src/annotations.js index 91d289b723..29d556ccd0 100644 --- a/modules/di/src/annotations.js +++ b/modules/di/src/annotations.js @@ -3,9 +3,11 @@ import {CONST} from "facade/lang"; /** * A parameter annotation that creates a synchronous eager dependency. * - * class AComponent { - * constructor(@Inject('aServiceToken') aService) {} - * } + * ``` + * class AComponent { + * constructor(@Inject('aServiceToken') aService) {} + * } + * ``` * */ export class Inject { @@ -19,11 +21,13 @@ export class Inject { /** * A parameter annotation that creates an asynchronous eager dependency. * - * class AComponent { - * constructor(@InjectPromise('aServiceToken') aServicePromise) { - * aServicePromise.then(aService => ...); - * } - * } + * ``` + * class AComponent { + * constructor(@InjectPromise('aServiceToken') aServicePromise) { + * aServicePromise.then(aService => ...); + * } + * } + * ``` * */ export class InjectPromise { @@ -37,11 +41,13 @@ export class InjectPromise { /** * A parameter annotation that creates a synchronous lazy dependency. * - * class AComponent { - * constructor(@InjectLazy('aServiceToken') aServiceFn) { - * aService = aServiceFn(); - * } - * } + * ``` + * class AComponent { + * constructor(@InjectLazy('aServiceToken') aServiceFn) { + * aService = aServiceFn(); + * } + * } + * ``` * */ export class InjectLazy { @@ -60,16 +66,20 @@ export class InjectLazy { * * For example: * - * class Parent extends DependencyAnnotation {} - * class NotDependencyProperty {} + * ``` + * class Parent extends DependencyAnnotation {} + * class NotDependencyProperty {} * - * class AComponent { - * constructor(@Parent @NotDependencyProperty aService:AService) {} - * } + * class AComponent { + * constructor(@Parent @NotDependencyProperty aService:AService) {} + * } + * ``` * * will create the following dependency: * - * new Dependency(Key.get(AService), [new Parent()]) + * ``` + * new Dependency(Key.get(AService), [new Parent()]) + * ``` * * The framework can use `new Parent()` to handle the `aService` dependency * in a specific way.