Page Contents
Home > @loopback/context > Context > findByTag
Context.findByTag() method
Find bindings using the tag filter. If the filter matches one of the binding tags, the binding is included.
Signature:
findByTag<ValueType = BoundValue>(tagFilter: BindingTag | RegExp): Readonly<Binding<ValueType>>[];
Parameters
| Parameter | Type | Description |
|---|---|---|
| tagFilter | [BindingTag](/doc/en/lb4/apidocs.context.bindingtag.html) \| RegExp | A filter for tags. It can be in one of the following forms: - A regular expression, such as `/controller/` - A wildcard pattern string with optional `*` and `?`, such as `'con*'` For a wildcard: - `*` matches zero or more characters except `.` and `:` - `?` matches exactly one character except `.` and `:` - An object containing tag name/value pairs, such as `{name: 'my-controller'}` |
Returns:
Readonly<Binding<ValueType>>[]