injectFromViewParentInjector function

Expression injectFromViewParentInjector(
  1. CompileView view,
  2. CompileTokenMetadata token,
  3. bool optional
)

Implementation

o.Expression injectFromViewParentInjector(
  CompileView view,
  CompileTokenMetadata token,
  bool optional,
) {
  final viewExpr = (view.viewType == ViewType.host)
      ? o.THIS_EXPR
      : o.ReadClassMemberExpr('parentView').notNull();
  return viewExpr.callMethod(optional ? 'injectorGetOptional' : 'injectorGet', [
    createDiTokenExpression(token),
    o.ReadClassMemberExpr('parentIndex'),
  ]);
}