Dependency injection is a design pattern used in AngularJS to allow components to be easily tested and to promote loose coupling between components. In AngularJS, dependencies are injected into components rather than being created within the component.