4 ms·
Re: module method definitions: is the IIFE still required if you'd just put a named function in the call to .controller()? I try to avoid boilerplate (like IIFE
by Cthulhu_ 12y ago
Re: module method definitions: is the IIFE still required if you'd just put a named function in the call to .controller()? I try to avoid boilerplate (like IIFE's) whenever possible; vanilla AngularJS doesn't seem to require IIFE's in most cases when defining controllers as anonymous functions.
Similarly, this approach seems to require adding a block of comment-boilerplate so ng-annotate doesn't get confused; inlining it would avoid this.
I can see that particular method for module definitions taking up seven lines of extra boilerplate code vs just inlining the (named) function in the call to .controller(), and I'm not seeing any definitive advantages.