The documentation says (Dependency injection (DI) | The Aurelia 2 Docs)
Services are usually resolved automatically via constructor injection. However, you can also resolve them manually:
const profileService: ProfileService = container.get(ProfileService);
But where does container
get from? It looks like that
const container = DI.createContainer()
creates a new container. How to get an instance from the Aurelia container before application starts?
const container = DI.createContainer()
const numberValueConverter = container.get(NumberValueConverter)
numberValueConverter.setLocale("de")
Aurelia
.register(NumberValueConverter)
.app(MyApp)
.start();