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

Function convertToProviderExpression

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

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

Callers 2

compileInjectableMethod · 0.85

Calls 1

Tested by

no test coverage detected