ManuKaracho
ManuKaracho

Reputation: 1218

How can I check if debug information is enabled in angular?

One can toggle angulars debug infos by calling

$compileProvider.debugInfoEnabled(debugInfoState);

within the config method of an angular app.

Is there a way of checking if debug information is enabled via the console when an app is running in the browser?

Upvotes: 5

Views: 3179

Answers (1)

georgeawg
georgeawg

Reputation: 48968

The debugInfoEnabled function is a setter/getter. It can be checked in a config block.

app.config(function ($compileProvider) {
    var debugEnabled = $compileProvider.debugInfoEnabled();
    console.log("debugInfoEnabled=", debugEnabled);
});

See the source code.

Upvotes: 3

Related Questions