Samshay
Samshay

Reputation: 143

$injector:strictdi - Angular Provider

I have an error in my code :

angular.js:38 Uncaught Error: [$injector:strictdi] http://errors.angularjs.org/1.5.0/$injector/strictdi?p0=%24exceptionHandler

I know this from a code style issue, but I can not find the syntax for it respects the "strictDi : true"

For information, when I do not use the parameter "strictDi : true ," my app works well.

Do you have an idea.

Thanks for your help.

cnaflog.provider(
    "$exceptionHandler",
    {
        $get: function( errorLogService ) {
            return( errorLogService );
        }
    }
);

Upvotes: 1

Views: 139

Answers (1)

dfsq
dfsq

Reputation: 193291

Use minification-safe dependency injection with array notation:

cnaflog.provider(
    "$exceptionHandler",
    {
        $get: ['errorLogService', function( errorLogService ) {
            return( errorLogService );
        }]
    }
);

Upvotes: 1

Related Questions