The controller defines the actual behavior of your app. It contains business logic for the view and connects the model to view with the help of $scope. A controller is associated with a HTML element with the ng-controller directive.
In real life application you should store controllers code in separate JS files like
Ctrlcontroller.js and to use it just add reference of your created Ctrlcontroller.js file.
I hope you have better understanding of controllers in AngularJS. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.