Injection
injecting a MikroORM connection can be done by the help of @inject
decorator from @triptyk/nfw-core
.
@singleton()
class UserController {
public constructor(
@inject(MikroORM) public mikroOrm: MikroORM
) {}
}
Injecting a repository
Injecting a repository can be achieved by using the @injectRepository
decorator from @triptyk/nfw-mikro-orm
.