generator-ng-component icon indicating copy to clipboard operation
generator-ng-component copied to clipboard

Applying John Papa Style Guide to generator-ng-component

Open remicastaing opened this issue 9 years ago • 2 comments

Here is an attempt to comply to John Papa Style Guide as evoked in https://github.com/DaftMonk/generator-angular-fullstack/issues/1119.

remicastaing avatar Aug 02 '15 21:08 remicastaing

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 (:

kingcody avatar Aug 05 '15 04:08 kingcody

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.

remicastaing avatar Aug 05 '15 08:08 remicastaing