logProvider error on injection


#1

Hi,

I am trying to use angular’s $logProvider like so:

angular.module('myapp', ['ionic'])
.run(['$ionicPlatform', '$logProvider', function($ionicPlatform, $logProvider) {
    $ionicPlatform.ready(function() {
        $logProvider.debugEnabled(false);
    }

But I get the following error when running on Android (ionic v1.2.14-beta3):

Uncaught Error: [$injector:unpr] Unknown provider: $logProviderProvider <- $logProvider http://errors.angularjs.org/1.2.25/$injector/unpr?p0=%24logProviderProvider%20%3C-%20%24logProvider ionic.bundle.js:11560

Any help would be greatly appreciated.
Thanks


#2

Hi.

You need to inject $logProvider into the configuration block instead, like the following:

angular.module('myapp', ['ionic'])
.config(['$logProvider', function($logProvider)
{
    $logProvider.debugEnabled(false)
}])