Dependencies in the service constructor
Closed this issue · 0 comments
S3bt3r commented
Hello everybody,
I have a problem. I get the following error when I define dependencies in the constructor of a service. If not, everything works without error.
JavaScript runtime error: [$injector:unpr] Unknown provider: $routeProviderProvider <- $routeProvider <- Nimbly.Shell.IAppRegisterService
Not Working Service:
class AppRegisterService implements IAppRegisterService {
...
constructor($log: ng.ILogService, $routeProvider: ng.route.IRouteProvider) {
Working Service:
class AppRegisterService implements IAppRegisterService {
...
constructor() {
Controller:
class ShellController implements IShellViewModel {
...
constructor($log: ng.ILogService, $mdSidenav: any, appRegister: IAppRegisterService) {
All dependencies are defined in the module. In other parts of the application do they work.
Can someone help me?