To avoid polluting the global scope, controllers should be encapsulated within a _________.

  • closure
  • controller
  • directive
  • module
To avoid polluting the global scope, controllers should be encapsulated within a module. Modules in AngularJS act as containers for different components of an application, providing a way to organize and structure the code. Encapsulating controllers within modules helps in managing dependencies, improving code maintainability, and preventing naming conflicts in large applications.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *