Page Contents

Home > @loopback/context > ResolutionOptions > optional

ResolutionOptions.optional property

A boolean flag to indicate if the dependency is optional. If it’s set to true and the binding is not bound in a context, the resolution will return undefined instead of throwing an error.

Signature:

optional?: boolean;