Begin abstracting global container into injector
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Application} from './Application'
|
||||
import {Container, DependencyKey} from '../di'
|
||||
import {Container, DependencyKey, Injectable} from '../di'
|
||||
|
||||
/**
|
||||
* Base type for a class that supports binding methods by string.
|
||||
@@ -25,12 +25,11 @@ export function isBindable(what: unknown): what is Bindable {
|
||||
/**
|
||||
* Base for classes that gives access to the global application and container.
|
||||
*/
|
||||
@Injectable()
|
||||
export class AppClass {
|
||||
/** The global application instance. */
|
||||
private readonly appClassApplication!: Application;
|
||||
|
||||
constructor() {
|
||||
this.appClassApplication = Application.getApplication()
|
||||
private get appClassApplication(): Application {
|
||||
return Application.getApplication()
|
||||
}
|
||||
|
||||
/** Get the global Application. */
|
||||
|
||||
Reference in New Issue
Block a user