Angular has this "auto-discovery" feature that allows it to search for controllers by their name if they are defined in a global scope.
This feature is mainly intended for quick demonstrations / prototypes / fragments of the evidence-based concept, and not for real applications.
From the Angular Developer's Guide :
NOTE. Although Angular allows you to create controller functions in a global scope, this is not recommended. In a real application, you should use the .controller method of your Angular module for your application [...]
Relatively empty ngApp , if no name is specified, this means that there is no module for assigning controllers, directives, services, but apart from this, everything works fine.
source share