In most cases, prefer bindRootContributionProvider instead. This variant retains a reference
to whichever container first resolves the provider. If that container is a short-lived child (e.g. a widget
container), the provider will keep the child — and everything cached in it — alive for the lifetime of the
application, causing a memory leak.
Use bindContributionProvider only when you are certain that some or all of the relevant services are
scoped to a child container rather than the root container — for example, inside a
ConnectionContainerModule (connection-scoped child containers).
Binds a ContributionProvider for the given service identifier.
In most cases, prefer bindRootContributionProvider instead. This variant retains a reference to whichever container first resolves the provider. If that container is a short-lived child (e.g. a widget container), the provider will keep the child — and everything cached in it — alive for the lifetime of the application, causing a memory leak.
Use
bindContributionProvideronly when you are certain that some or all of the relevant services are scoped to a child container rather than the root container — for example, inside a ConnectionContainerModule (connection-scoped child containers).