From your list, only code minification purposes are relevant, the other two aren't.
There's one more potential benefit though. Consider a document that loads angular, then your script, and then another script. The final script could change angular
in the global namespace (loading a newer version, or something malicious even) at a later time, causing your code to behave erratically.
Here's an example:
////////////////////
// 1. Angular is loaded directly.
////////////////////
// 2. Your code:
(function() {
'use strict';
window.setInterval(function() {
console.log(angular.version.full);
document.write(angular.version.full + "<br>");
}, 1000);
// more code here
})();
////////////////////
// 3. Another snippet/library:
window.setTimeout(function() {
window.angular = { version: { full: "muhahaha!" } };
}, 2500);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
The "muhahahas" would not appear with the other variant:
////////////////////
// 1. Angular is loaded directly.
////////////////////
// 2. Your code:
(function(window, angular) {
'use strict';
window.setInterval(function() {
console.log(angular.version.full);
document.write(angular.version.full + "<br>");
}, 1000);
// more code here
})(window, window.angular);
////////////////////
// 3. Another snippet/library:
window.setTimeout(function() {
window.angular = { version: { full: "muhahaha!" } };
}, 2500);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>