# removeDefinition method

1. @override

Future<void> removeDefinition(

1. String name

)
override

Remove the pod associated with `name`.

This method removes a pod from the registry, making the name available for reuse (depending on implementation constraints).

`name`: The name of the pod to remove

Throws:

- NoSuchPodDefinitionException if no pod exists with the given name

Example:

    if (registry.containsDefinition('oldService')) {
      registry.removeDefinition('oldService');
      print('Removed oldService from registry');
    }

## Implementation

    @override
    Future<void> removeDefinition(String name) async {
      final removed = _definitions.remove(name);
      if (removed == null) {
        throw NoSuchPodDefinitionException.byName(name);
      }

      // Clean up aliases pointing to this name
      final aliases = getAliases(name).toList();
      for (final alias in aliases) {
        removeAlias(alias);
      }
    }