Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95c2738

Browse files
committed
docs($log): update example to use a module
1 parent e83c5ba commit 95c2738

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ng/log.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
* {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.
1616
*
1717
* @example
18-
<example>
18+
<example module="logExample">
1919
<file name="script.js">
20-
function LogCtrl($scope, $log) {
21-
$scope.$log = $log;
22-
$scope.message = 'Hello World!';
23-
}
20+
angular.module('logExample', [])
21+
.controller('LogController', ['$scope', '$log', function($scope, $log) {
22+
$scope.$log = $log;
23+
$scope.message = 'Hello World!';
24+
}]);
2425
</file>
2526
<file name="index.html">
26-
<div ng-controller="LogCtrl">
27+
<div ng-controller="LogController">
2728
<p>Reload this page with open console, enter text and hit the log button...</p>
2829
Message:
2930
<input type="text" ng-model="message"/>

0 commit comments

Comments
 (0)