docs: format null as code fragment + fix description of returned value (#40852)
PR Close #40852
This commit is contained in:
parent
e3c21c5465
commit
f4f7c33e1f
|
@ -126,7 +126,7 @@ Please check that 1) the type for the parameter at index ${
|
|||
* @param flags Optional flags that control how injection is executed.
|
||||
* The flags correspond to injection strategies that can be specified with
|
||||
* parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
|
||||
* @returns True if injection is successful, null otherwise.
|
||||
* @returns the injected value if injection is successful, `null` otherwise.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
|
|
|
@ -71,14 +71,14 @@ export interface OptionalDecorator {
|
|||
/**
|
||||
* Parameter decorator to be used on constructor parameters,
|
||||
* which marks the parameter as being an optional dependency.
|
||||
* The DI framework provides null if the dependency is not found.
|
||||
* The DI framework provides `null` if the dependency is not found.
|
||||
*
|
||||
* Can be used together with other parameter decorators
|
||||
* that modify how dependency injection operates.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* The following code allows the possibility of a null result:
|
||||
* The following code allows the possibility of a `null` result:
|
||||
*
|
||||
* <code-example path="core/di/ts/metadata_spec.ts" region="Optional">
|
||||
* </code-example>
|
||||
|
@ -118,7 +118,7 @@ export interface SelfDecorator {
|
|||
* which tells the DI framework to start dependency resolution from the local injector.
|
||||
*
|
||||
* Resolution works upward through the injector hierarchy, so the children
|
||||
* of this class must configure their own providers or be prepared for a null result.
|
||||
* of this class must configure their own providers or be prepared for a `null` result.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
|
@ -216,7 +216,7 @@ export interface HostDecorator {
|
|||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* The following shows use with the `@Optional` decorator, and allows for a null result.
|
||||
* The following shows use with the `@Optional` decorator, and allows for a `null` result.
|
||||
*
|
||||
* <code-example path="core/di/ts/metadata_spec.ts" region="Host">
|
||||
* </code-example>
|
||||
|
@ -244,4 +244,4 @@ export interface Host {}
|
|||
export const Host: HostDecorator =
|
||||
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
|
||||
// tslint:disable-next-line: no-toplevel-property-access
|
||||
attachInjectFlag(makeParamDecorator('Host'), InternalInjectFlags.Host);
|
||||
attachInjectFlag(makeParamDecorator('Host'), InternalInjectFlags.Host);
|
||||
|
|
Loading…
Reference in New Issue