@loopback/docs
Version:
Documentation for LoopBack 4
23 lines (15 loc) • 758 B
Markdown
lang: en
title: 'API docs: context.resolutionoptions.optional'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.resolutionoptions.optional.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ResolutionOptions](./context.resolutionoptions.md) > [optional](./context.resolutionoptions.optional.md)
## 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.
<b>Signature:</b>
```typescript
optional?: boolean;
```