public class AngularController<T extends Scope>
extends java.lang.Object
AngularController and define an onInit method taking at least one
Scope object. Each parameter of the onInit method is assumed to be an injectable type, either
a builtin type, or a custom injectable type defined by NgInject.
Any additional public methods defined will automatically be exported to the $scope object used by
the controller and callable from the view.
public class MyController extends AngularController {
public void onInit(Scope scope) {
// publish key "foo" with value "bar" into $scope
scope.put("foo", "bar");
}
// automatically published as $scope.doIt
public void doIt(String arg) {
Window.alert(scope.getString("foo") + " " + arg);
}
}
See the documentation for Scope for how to define custom Scope subtypes with type-safe accessors.| Modifier | Constructor and Description |
|---|---|
protected |
AngularController() |