New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to call Loopback4 controller's method from another controller? #3028
Comments
You should be able to inject another controller. Pls show your code. |
Check out similar examples at https://github.com/strongloop/loopback-next/tree/master/examples/context |
It should be as simple as |
Alright, so to inject a repository in a controller, I do this, in the constructor of the controller: I tried |
Simply use |
Description / Steps to reproduce / Feature proposal
I have a loopback 4 controller with a function that I don't want to expose via HTTP.
I would like to be able to call the function from another controller. How can I do this? Is there any way of injecting a controller in another controller? (I 'm able to inject repositories in controllers, but not controllers in controllers)
Current Behavior
Expected Behavior
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: