doc($log): correct non-working example

This commit is contained in:
Misko Hevery 2012-06-12 10:01:43 -07:00
parent 152537c4e9
commit 300c5c0c99

View file

@ -12,27 +12,25 @@
* The main purpose of this service is to simplify debugging and troubleshooting. * The main purpose of this service is to simplify debugging and troubleshooting.
* *
* @example * @example
<doc:example> <example>
<doc:source> <file name="script.js">
<script> function LogCtrl($scope, $log) {
function LogCtrl($log) { $scope.$log = $log;
this.$log = $log; $scope.message = 'Hello World!';
this.message = 'Hello World!'; }
} </file>
</script> <file name="index.html">
<div ng-controller="LogCtrl"> <div ng-controller="LogCtrl">
<p>Reload this page with open console, enter text and hit the log button...</p> <p>Reload this page with open console, enter text and hit the log button...</p>
Message: Message:
<input type="text" ng-model="message"/> <input type="text" ng-model="message"/>
<button ng-click="$log.log(message)">log</button> <button ng-click="$log.log(message)">log</button>
<button ng-click="$log.warn(message)">warn</button> <button ng-click="$log.warn(message)">warn</button>
<button ng-click="$log.info(message)">info</button> <button ng-click="$log.info(message)">info</button>
<button ng-click="$log.error(message)">error</button> <button ng-click="$log.error(message)">error</button>
</div> </div>
</doc:source> </file>
<doc:scenario> </example>
</doc:scenario>
</doc:example>
*/ */
function $LogProvider(){ function $LogProvider(){