angular-styleguide
angular-styleguide copied to clipboard
Y022 - Naming Conventions For Functions Inside IIFE
Are named functions used in this pattern solely for easier debugging?
/* recommended */
angular
.module('app')
.controller('SomeController', SomeController);
function SomeController() { }
I have been using an internal naming convention to easier isolate the controller name when fuzzy searching:
angular
.module('app')
.controller('SomeController', Internal);
Internal.$inject = [];
function Internal() { }
Same naming for injector and function name also help a lot when you want to rename something.