mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
doc($log): correct non-working example
This commit is contained in:
parent
7a5f25f667
commit
e8ded01cf5
1 changed files with 19 additions and 21 deletions
|
|
@ -12,27 +12,25 @@
|
|||
* The main purpose of this service is to simplify debugging and troubleshooting.
|
||||
*
|
||||
* @example
|
||||
<doc:example>
|
||||
<doc:source>
|
||||
<script>
|
||||
function LogCtrl($log) {
|
||||
this.$log = $log;
|
||||
this.message = 'Hello World!';
|
||||
}
|
||||
</script>
|
||||
<div ng-controller="LogCtrl">
|
||||
<p>Reload this page with open console, enter text and hit the log button...</p>
|
||||
Message:
|
||||
<input type="text" ng-model="message"/>
|
||||
<button ng-click="$log.log(message)">log</button>
|
||||
<button ng-click="$log.warn(message)">warn</button>
|
||||
<button ng-click="$log.info(message)">info</button>
|
||||
<button ng-click="$log.error(message)">error</button>
|
||||
</div>
|
||||
</doc:source>
|
||||
<doc:scenario>
|
||||
</doc:scenario>
|
||||
</doc:example>
|
||||
<example>
|
||||
<file name="script.js">
|
||||
function LogCtrl($scope, $log) {
|
||||
$scope.$log = $log;
|
||||
$scope.message = 'Hello World!';
|
||||
}
|
||||
</file>
|
||||
<file name="index.html">
|
||||
<div ng-controller="LogCtrl">
|
||||
<p>Reload this page with open console, enter text and hit the log button...</p>
|
||||
Message:
|
||||
<input type="text" ng-model="message"/>
|
||||
<button ng-click="$log.log(message)">log</button>
|
||||
<button ng-click="$log.warn(message)">warn</button>
|
||||
<button ng-click="$log.info(message)">info</button>
|
||||
<button ng-click="$log.error(message)">error</button>
|
||||
</div>
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
|
||||
function $LogProvider(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue