A controller in AngularJS is an object attached to a DOM element that initializes and adds behaviour to the scope at that element.
We have already seen many application controllers, instantiated by the
ng-controller directive. These controllers should not interact directly with the DOM but should deal only with the current scope.
A directive controller is a special form of controller that is defined by a directive and instantiated each time that directive appears on a DOM element. Its role is to initialize and provide behavior for the directive rather than a scope.
You define a directive controller using the
controller property on the directive definition object. The
controller property can be a string containing ...