4 ms·
> Dependency Injection: Are you kidding me? He's not even using the array notation for proper DI with minification. Can I just say that this is the single thin
by bphogan 11y ago
> Dependency Injection: Are you kidding me? He's not even using the array notation for proper DI with minification.
Can I just say that this is the single thing that really irritates me about Angular?
This has been the "gotcha" forever... why are all the guides not using this syntax by default? Why is this just not "the way you do things" if everyone knows this is a problem?
- joeyrobert 11y agoThe array notation can be automatically added to your build tool (gulp, grunt) using ngAnnotate: https://github.com/olov/ng-annotate https://github.com/olov/ng-annotate. This reduces the amount of duplication and Angular boilerplate around dependency injection. Most Angular projects I've worked on use this, making the Angular guides relevant.