angular.scope.$become

Work In Progress This page is currently being revised. It might be incomplete or contain inaccuracies.
Deprecated API This method will be removed before 1.0

Description

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.

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.

Usage

angular.scope.$become();

Parameters