Log debug information

Description

The following code shows how to Log debug information.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from w  w  w . j  ava2  s  . c  o  m-->
<body>
  <div ng-app="app">
    <div ng-controller="MainCtrl">
        <h3>Make sure to open a javascript console so you can see the output.</h3>
    </div>
</div>
<script type='text/javascript'>
angular.module('app', []).controller('MainCtrl', ['$log', function($log){
    $log.debug('Hello Debug!');
}]);
</script>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities