# removeDefinition method

1. @override

Future<void> removeDefinition(

1. String podName

)
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 podName) async {
      if (_configurationFrozen) {
        throw PodDefinitionStoreException(
          name: podName,
          msg: "Cannot remove pod definition '$podName': factory is frozen"
        );
      }

      if (containsDefinition(podName)) {
        await getPodRegistry().removeDefinition(podName);

        _frozenPodDefinitionNames = [];
        resetDefinition(podName);
      }

      final parent = getParentFactory();
      if (parent != null && parent is DefaultListablePodFactory && parent.containsDefinition(podName)) {
        await parent.removeDefinition(podName);
      }
    }