Question: why use iife in angularjs?
Answer: Immediately Invoked Function Expressions (IIFE) Wrapping your AngularJS components in an Immediately Invoked Function Expression (IIFE). This helps to prevent variables and function declarations from living longer than expected in the global scope, which also helps avoid variable collisions.