Please enable Javascript to correctly display the contents on Dot Net Tricks!


Posted On : 05 Feb 2015
Updated On : 10 Feb 2015
Total Views : 6871

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.

Controller Example

MVC pattern in AngulaJS


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.

What do you think?

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.