How does DI benefit in Angular

The big benefit of DI is Code Separation and Testing.

With Code Separation

We don't need to bother anymore about order of initialization of certain components. If A is dependent on B then DI will make sure that B is ready when A needs it.

When code is separated it's naturally easier for testing.

results matching ""

    No results matching ""