Modifies the scope to act like an instance of the given class by:
That makes the scope be a this
for the given class's methods — effectively an instance of
the given class with additional (scope) stuff. A scope can later $become
another class.
$become
gets used to make the current scope act like an instance of a controller class.
This allows for use of a controller class in two ways.
scope.$become(ControllerClass)
.Either way, the controller's methods refer to the model variables like this.name
. When
stored in a scope, the model supports data binding. When bound to a view, {{name}} in the
HTML template refers to the same variable.