To support the Model-View-Controller design pattern, it is possible
to assign behavior to a scope through ng:controller. The scope is
the MVC model. The HTML (with data bindings) is the MVC view.
The ng:controller directive specifies the MVC controller class
Usage
<ANY ng:controller="expression">
...
</ANY>
Parameters
expression – {expression} –
to eval.
Example
Here is a simple form for editing the user contact information. Adding, removing clearing and
greeting are methods which are declared on the controller (see source tab). These methods can
easily be called from the angular markup. Notice that the scope becomes the controller's class
this. This allows for easy access to the view data from the controller. Also notice that any
changes to the data are automatically reflected in the view without the need to update it
manually.