Controllers are basic building blocks of an AngularJS application and you can't get by without writing a few. These are pure JS functions and you can create them as global functions as shown in most of the tutorials.

But, and that's a very big but, polluting global namespace like this is never a good idea in a JS app. AngularJS, being as good as it is, provides an excellent way to create controllers in a modular way using API that is similar to the one we use to create directives, services and filters.

Please take a look at the fiddle below. The idea is using module.controller to define a controller and using the controller "name" string expression everywhere as shown in the fiddle. And that's it. As simple as that :).