angularjs-log

How to turn on/off $log.debug in AngularJS

我的梦境 提交于 2019-11-28 16:27:58
I'm trying to use $log.debug("Foo"). How can it be turned on off. I can't find a sample anywhere. I think it need to be set in the config, but I cant seem to get that to work either. Where does one set the on and off switch? rgaskill $logProvider.debugEnabled(true) This is only available in AngularJs 1.1.2 or later. https://github.com/angular/angular.js/pull/1625 Here is an example of it being set. var app = angular.module('plunker', []); app.config(function($logProvider){ $logProvider.debugEnabled(true); }); app.controller('MainCtrl', function($scope, $log ) { $scope.name = 'World'; $scope

How to turn on/off $log.debug in AngularJS

我是研究僧i 提交于 2019-11-27 09:43:17
问题 I'm trying to use $log.debug("Foo"). How can it be turned on off. I can't find a sample anywhere. I think it need to be set in the config, but I cant seem to get that to work either. Where does one set the on and off switch? 回答1: $logProvider.debugEnabled(true) This is only available in AngularJs 1.1.2 or later. https://github.com/angular/angular.js/pull/1625 Here is an example of it being set. var app = angular.module('plunker', []); app.config(function($logProvider){ $logProvider