Constructor
new Injector()
Initialize the injector with a reference to itself as a dependency.
- Source:
Methods
filter(predicate) → {DependencyCollection}
Query the injector for dependencies matching a predicate
Parameters:
Name | Type | Description |
---|---|---|
predicate |
Object | function | Description or function for matching dependencies |
- Source:
Returns:
- Type
- DependencyCollection
get(name) → {*}
Get a dependency from the injector by invoking it's function or value property.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Dependency name |
- Source:
Returns:
- Type
- *
invoke(name)
Lifecycle callbacks which use dependencies on the injector, but return no values can be registered on the injector for event handling. This method invokes such callbacks by name, providing any required dependencies as arguments. It fails silently if no callback is found.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Dependency name |
- Source:
- To Do:
-
- consider consolidating repeated code in invoke and get into a single 'internal' #todo function and wrap it for get and invoke functionality
register(descriptor)
Register a Dependency instance on the injector without invoking its factory function.
Parameters:
Name | Type | Description |
---|---|---|
descriptor |
Object | Dependency properties |
- Source: