Dependency injection is a concept that allows software components to be built having dependencies without bothering about creation and management of that dependencies. It is a good design pattern allowing to build loosely couples components in software.
Angular JS
We can create directives in AngularJS to bring our own HTML tags or attributes, or even special CSS classes or comments. It is most used for building HTML elements and attributes and rarely used for classes and comments. Using directives we can simplify application's HTML markup and have more organized code.