Hi,

I'm using the decorator to decorate the $log and the $exceptionHandler 
services and I want to set the logger level and some other stuff in the log 
decorator base on configuration that I retrieve from the server,

The configuration from the server is being retrieved by using the resolve 
of $routeProvider  

templateUrl: 'pages/home.html',
    controller: 'HomeCtrl',
    resolve: {
        myConfig: function (appConfig) {
            return appConfig.retreiveConfig();
        }
    }




I tried to $rootScope.$broadcast an event when I retrieve the config from 
the server and use  $injector.get('$rootScope'); inside the log decorator , 
like this

        var $rootScope = $injector.get('$rootScope');
        $rootScope.$on('app-config-loaded', function (event, one, two) {
            console.log('heard something...');
        });

But I'm getting Uncaught Error: [$injector:cdep] Circular dependency found: 
$log <- $exceptionHandler <- $rootScope

Original 
question: 
http://stackoverflow.com/questions/22980830/how-to-access-server-side-configuration-in-log-decorator

How can I use the configuration loaded in the routing resolve inside my 
$log decorator ?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to