MCPcopy Create free account
hub / github.com/angular/angular / convertToProviderExpression

Function convertToProviderExpression

packages/compiler/src/jit_compiler_facade.ts:821–833  ·  view source on GitHub ↗

* Convert the expression, if present to an `R3ProviderExpression`. * * In JIT mode we do not want the compiler to wrap the expression in a `forwardRef()` call because, * if it is referencing a type that has not yet been defined, it will have already been wrapped in * a `forwardRef()` - either by

(
  obj: any,
  property: string,
)

Source from the content-addressed store, hash-verified

819 * use `ForwardRefHandling.None`.
820 */
821function convertToProviderExpression(
822 obj: any,
823 property: string,
824): MaybeForwardRefExpression | undefined {
825 if (Object.hasOwn(obj, property)) {
826 return createMayBeForwardRefExpression(
827 new WrappedNodeExpr(obj[property]),
828 ForwardRefHandling.None,
829 );
830 } else {
831 return undefined;
832 }
833}
834
835function wrapExpression(obj: any, property: string): WrappedNodeExpr<any> | undefined {
836 if (Object.hasOwn(obj, property)) {

Callers 2

compileInjectableMethod · 0.85

Calls 1

Tested by

no test coverage detected