I've seen a few developers tout 'best practices' when wrapping angular components in anonymous functions. For example:
(function(){
     angular.controller('MyCtrl', [function(){
         // ... controller logic
     }]);
})()
What is the benefit of wrapping angularjs components in anonymous functions, if at all any?
 
    