Controller class
Supports grouping routes with shared functionality.
Constructors
- Controller({bool injectSingleton = true, Expose? expose})
Properties
- app → Angel
-
The Angel application powering this controller.
no setter
- expose → Expose?
-
Mount path, name and middleware for this controller, used in place of a
class-level
@Exposeannotation.final - hashCode → int
-
The hash code for this object.
no setterinherited
- injectSingleton → bool
-
If
true(default), this class will inject itself as a singleton into the app's container when bootstrapped.final -
middleware
↔ List<
RequestHandler> -
Middleware to run before all handlers in this class.
getter/setter pair
-
mountPoint
→ SymlinkRoute<
RequestHandler> ? -
The route at which this controller is mounted on the server.
no setter
-
routeMappings
↔ Map<
String, Route> -
A mapping of route paths to routes, produced from the Expose annotations on this class.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
applyRoutes(
Router< RequestHandler> router, Reflector reflector) → Future<String> -
Applies the routes from this Controller to some
router. -
configureRoutes(
Routable routable) → FutureOr< void> - Used to add additional routes or middlewares to the router from within a Controller.
-
configureServer(
Angel app) → Future< void> -
Applies routes, DI, and other configuration to an
app. -
findExpose(
Reflector reflector, {bool concreteOnly = false}) → Expose? - Finds the Expose declaration for this class.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
routesMethod(
ReflectedDeclaration declaration) → bool -
Whether the public method
declaration, found through the reflector, is a route of this controller. All are, but those annotated@noExpose; a subclass may keep others off its routes, such as those of another protocol. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited