* Retrieves an instance (or a list of instances) of either injectable or controller, otherwise, throws exception. * @returns {TResult | Array<TResult>}
(
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
options: GetOrResolveOptions = { strict: false },
)
| 163 | * @returns {TResult | Array<TResult>} |
| 164 | */ |
| 165 | public get<TInput = any, TResult = TInput>( |
| 166 | typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, |
| 167 | options: GetOrResolveOptions = { strict: false }, |
| 168 | ): TResult | Array<TResult> { |
| 169 | return !(options && options.strict) |
| 170 | ? this.find<TInput, TResult>(typeOrToken, options) |
| 171 | : this.find<TInput, TResult>(typeOrToken, { |
| 172 | moduleId: this.contextModule?.id, |
| 173 | each: options.each, |
| 174 | }); |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Resolves transient or request-scoped instance of either injectable or controller, otherwise, throws exception. |