injectFromViewParentInjector function
Expression
injectFromViewParentInjector(
- CompileView view,
- CompileTokenMetadata token,
- 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'),
]);
}