What is a controller in Angular JS?

Question :

 What is a controller in Angular JS?

A controller is a JavaScript function which is bound to the specified scope. Angular instantiates the new controller injects the new scope as a dependency. It can be used to set up the initial state of the scope object and to add behavior to the object. It cannot be to share code or state across controllers, but instead of that Angular service can be used.

Example,
<Any ng-Controller=" expression">
</Any>
<div ng-app="mainApp" ng-controller="SimpleController">
</div>


Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad