attach method

void attach(
  1. DiContainer container
)

Attaches container without taking lifecycle ownership.

An existing attachment must be removed explicitly with detach.

Implementation

void attach(final DiContainer container) {
  if (_container != null) {
    throw const DiServiceLocatorAlreadyAttachedException();
  }
  _container = container;
}