mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-26 14:43:59 +00:00
doc($log): fix the $log service example
is no longer auto-published on the root scope, so we need to publish it via a controller
This commit is contained in:
parent
21b2a5bd21
commit
b7a7fc7065
1 changed files with 14 additions and 7 deletions
|
|
@ -15,13 +15,20 @@
|
||||||
* @example
|
* @example
|
||||||
<doc:example>
|
<doc:example>
|
||||||
<doc:source>
|
<doc:source>
|
||||||
<p>Reload this page with open console, enter text and hit the log button...</p>
|
<script>
|
||||||
Message:
|
function LogCtrl($log) {
|
||||||
<input type="text" name="message" value="Hello World!"/>
|
this.$log = $log;
|
||||||
<button ng:click="$log.log(message)">log</button>
|
}
|
||||||
<button ng:click="$log.warn(message)">warn</button>
|
</script>
|
||||||
<button ng:click="$log.info(message)">info</button>
|
<div ng:controller="LogCtrl">
|
||||||
<button ng:click="$log.error(message)">error</button>
|
<p>Reload this page with open console, enter text and hit the log button...</p>
|
||||||
|
Message:
|
||||||
|
<input type="text" name="message" value="Hello World!"/>
|
||||||
|
<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:source>
|
||||||
<doc:scenario>
|
<doc:scenario>
|
||||||
</doc:scenario>
|
</doc:scenario>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue