loopbackio / loopbackio/loopback-next

How to call provider during application boot

Open
#2,064 3 comments 0 reactions 0 assignees View on GitHub
Docs good first issue
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

## Description / Steps to reproduce / Feature proposal
Hi, I have a Provider bind to services.MyProvider in application.ts, I need call the Provider inside a method in application.ts

## Current Behavior
```ts
constructor(options: ApplicationConfig = {}) {
super(options);
this.sequence(MySequence);
this.projectRoot = __dirname;
this.bind('services.MyProvider').toClass(
MyProvider
);
this.bootOptions = {
controllers: {
dirs: ['controllers'],
extensions: ['.controller.js'],
nested: true,
},
};
try {
this.callFunctionMyProvider();
} catch (error) {
console.log(error);
}
}
```

TIA

Contributor guide

Open the contributing guide

Research direction

Review the application.ts constructor and the services.MyProvider binding shown in the issue, then trace the application's boot lifecycle to identify where provider access belongs. Done means documenting or specifying a supported way to call the provider during application startup, with any relevant usage example or test identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.