demo.html:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>AngularJS</title> <script src="angular.min.js"></script> <!-- Introduce AngularJS framework--> </head> <body ng-app="App"> <div ng-controller="DemoController"> </div> <script> var App = angular.module('App',[]); // $log log service App.controller("DemoController",['$scope','$log',function($scope,$log) { $log.info('Normal information'); // See the log in the console in the browser $log.warn('Warning message'); $log.error('error message'); $log.log('print information'); // equivalent to console.log(); $log.debug('Debug information'); }]); </script> </body> </html>