AngularJS: What is the difference between $ log and console.log?

I passed through the angularJsdoc and learned about the log, warn, erroretc. Now, to see the result, we need to open the console, so my question is

, if you already have it console.log(), to see errors in the console, then it is used $logwhere is the place / scenerio, which should include the use $logof mine angularJs application.

How can I use $ log to store information in a file about my logging actions.

+4
source share
1 answer

, $log - AngularJs , , console.log() java script.

$log , . $log , .

, , - , , $log.info():

myApp.config(['$stateProvider', '$urlRouterProvider', '$logProvider', function ($stateProvider, $urlRouterProvider, $logProvider)
{
    $urlRouterProvider.otherwise("/home");
    $logProvider.debugEnabled(isDebugMode);
}]);

. $logProvider, .

:

+2

Source: https://habr.com/ru/post/1629898/


All Articles