(
...specs: BindingSpec[]
)
| 99 | * A list of binding scope/tags or template functions to configure the binding |
| 100 | */ |
| 101 | export function provider( |
| 102 | ...specs: BindingSpec[] |
| 103 | ): (target: Constructor<unknown>) => void { |
| 104 | return (target: Constructor<unknown>) => { |
| 105 | if (!isProviderClass(target)) { |
| 106 | throw new Error(`Target ${target} is not a Provider`); |
| 107 | } |
| 108 | injectable( |
| 109 | // Set up the default for providers |
| 110 | asProvider(target), |
| 111 | // Call other template functions |
| 112 | ...specs, |
| 113 | )(target); |
| 114 | }; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | /** |
nothing calls this directly
no test coverage detected