I am trying to disable debug info by putting $compileProvider.debugInfoEnabled(false); in angular.config(). But why is that when I check in the chrome browser, I can still see the number of watchers with angular watchers plugin. It feels like the debug info is not disabled.
How can I disable it?
Example of my working code:
angular.module('app.core.config', [])
.config(['$compileProvider', function ($compileProvider) {
// disable debug info
$compileProvider.debugInfoEnabled(false);
}]);
It's because Ionic overrides the default behavior:
/**
* @private
* Parts of Ionic requires that $scope data is attached to the element.
* We do not want to disable adding $scope data to the $element when
* $compileProvider.debugInfoEnabled(false) is used.
*/
IonicModule.config(['$provide', function($provide) {
$provide.decorator('$compile', ['$delegate', function($compile) {
$compile.$$addScopeInfo = function $$addScopeInfo($element, scope, isolated, noTemplate) {
var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';
$element.data(dataName, scope);
};
return $compile;
}]);
}]);
If you inject the $compile service you can inspect it and see that $$addScopeInfo is not the noop function as it usually is when debug info is disabled:
$$addBindingClass: noop()
$$addBindingInfo: noop()
$$addScopeClass: noop()
$$addScopeInfo: $$addScopeInfo($element, scope, isolated, noTemplate)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With