Skip to content

Disabled global $log.debug() on localhost #53

@darosh

Description

@darosh

This code:

angular.module("materialCalendar").constant("materialCalendar.config", {
     version: "0.2.13",
     debug: document.domain.indexOf("localhost") > -1
});

angular.module("materialCalendar").config(["materialCalendar.config", "$logProvider", "$compileProvider", function (config, $logProvider, $compileProvider) {
    if (config.debug) {
        $logProvider.debugEnabled(false);
        $compileProvider.debugInfoEnabled(false);
    }
}]);
  • leads to disabled $log.debug in whole app on localhost (which is probably opposite of intended goal as we usually debug on localhost only)
  • disabling global $log.debug by directive is sort of unexpected and unwanted behaviour (I thought my browser console is broken 😄)
  • $log.debug is not used at all in the calendar directive so the $logProvider.debugEnabled(false); can be removed anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions