By default, LoopBack uses PascalCase keys when binding controller classes, see e.g. this test:
https://github.com/strongloop/loopback-next/blob/0444120cda7119c66bc2170f4817e67d8dc9d312/packages/core/src/tests/unit/application.unit.ts#L25-L33
expect(binding.key).to.equal('controllers.MyController');
Your example does not provide enough information, so I'll assume your controller is defined as a class PointController
in src/controllers/point.controller.ts
file and you are using @loopback/boot
to load and register your application's artifacts.
In that case, you need to fix your code as follows - notice the upper-case P
:
@inject('controllers.PointController')
Additional information
In the future, you can use debug logs to find binding keys created for the different artifacts. On Unix (MacOS, Linux):
DEBUG=loopback:context:binding npm start
In the debug log, you should see a message like this:
loopback:context:binding Bind controllers.PointController to class PointController
The part controllers.PointController
is the binding key to use for @inject
, the part PointController
is the name of the controller class.