register<T extends ZenController> method
Register this controller in the DI container
Implementation
T register<T extends ZenController>({
String? tag,
bool isPermanent = false,
ZenScope? scope,
}) {
if (this is T) {
if (scope != null) {
return scope.put<T>(this as T, tag: tag, isPermanent: isPermanent);
} else {
return Zen.put<T>(this as T, tag: tag, isPermanent: isPermanent);
}
}
throw Exception('Controller is not of type $T');
}