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>


Similar Questions


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz