Interface with methods used to set references for components that depend on other components.
Description
The IReferenceable interface allows you to set references for components that depend on other components.
Important points
- If a component requires explicit notification to unset references, it must also implement the IUnreferenceable interface.
Instance methods
setReferences
Sets references to dependent components.
setReferences(references: IReferences): void
- references: IReferences - references to locate the component’s dependencies.
Examples
type MyController {
_persistence IPersistence
}
func (mc* MyController) SetReferences(ctx context.Context, references IReferences) {
mc._persistence = references.GetOneRequired(
NewDescriptor("mygroup", "persistence", "*", "*", "1.0"))
);
}