generator-ng-component
generator-ng-component copied to clipboard
Applying John Papa Style Guide to generator-ng-component
Here is an attempt to comply to John Papa Style Guide as evoked in https://github.com/DaftMonk/generator-angular-fullstack/issues/1119.
Hi @remicastaing, thanks for the work you've done here. A couple of thoughts...
If we use https://github.com/johnpapa/angular-styleguide#style-y024, then we'll need to:
FN.$inject = ['injectable1', 'injectable2', 'injectable3'];
for every (controller|service|factory|provider)... So I am personally not 100% sold on that.
Also, if we don't end up using named functions, then I don't really see a need in the IIFE's since we won't be polluting the global namespace.
Other than that, I'm good with everything else (:
Hello @kingcody. I didn't complied to rule y024, because it worked for me without. We should instead comply to https://github.com/johnpapa/angular-styleguide#style-y100 (comment functions that need automated dependency injection using /** @ngInject */
).
I like to name functions because it's, IMO, more readable and the file is flatter, so I added IIFE to all files.