DamianEdwards / grunt-tsng

A TypeScript pre-processor for AngularJS
Apache License 2.0
29 stars 3 forks source link

Dependencies in the service constructor #8

Closed S3bt3r closed 5 years ago

S3bt3r commented 9 years ago

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?