injectFromParentOptional method

  1. @protected
Object injectFromParentOptional(
  1. Object token,
  2. [Object orElse = throwIfNotFound]
@protected, inherited

Injects and returns an object representing token from the parent.

Unlike inject, this only checks instances registered directly with the parent injector, not this injector, or further ancestors. This is equivalent to constructor parameters annotated with @Host.


Object injectFromParentOptional(
  Object token, [
  Object orElse = throwIfNotFound,
]) =>
    parent.injectFromSelfOptional(token, orElse);