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

Function convertToProviderExpression

packages/compiler/src/jit_compiler_facade.ts:815–827  ·  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

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

Callers 2

compileInjectableMethod · 0.85

Calls 1

Tested by

no test coverage detected