changed the documentation @example to use <doc:example>

This commit is contained in:
Misko Hevery
2011-01-31 16:21:29 -08:00
parent ed768ebc53
commit ba6b68b6ae
20 changed files with 1841 additions and 1653 deletions

View File

@@ -46,12 +46,13 @@ You can use these variables in the function:
the DOM in addition to transforming the input.
@exampleDescription
@example
The following example filter reverses a text string. In addition, it conditionally makes the
text upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM
modification).
@example
<doc:example>
<doc:source>
<script type="text/javascript">
angular.filter('reverse', function(input, uppercase, color) {
var out = "";
@@ -73,4 +74,14 @@ You can use these variables in the function:
Reverse: {{text|reverse}}<br>
Reverse + uppercase: {{text|reverse:true}}<br>
Reverse + uppercase + blue: {{text|reverse:true:"blue"}}
</doc:source>
<doc:scenario>
it('should reverse text', function(){
expect(binding('text|reverse')).toEqual('olleh');
input('text').enter('ABC');
expect(binding('text|reverse')).toEqual('CBA');
});
</doc:scenario>
</doc:example>