aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
authorMisko Hevery2011-01-31 16:21:29 -0800
committerMisko Hevery2011-02-01 10:00:09 -0800
commitba6b68b6ae2bb2400a75ca2834fee47bfd60f1c6 (patch)
tree94f08ee16f270dd5f6238fb77064c91c624df931 /src/Compiler.js
parented768ebc53ef6746ca83d81892c22d2e9c3afeef (diff)
downloadangular.js-ba6b68b6ae2bb2400a75ca2834fee47bfd60f1c6.tar.bz2
changed the documentation @example to use <doc:example>
Diffstat (limited to 'src/Compiler.js')
-rw-r--r--src/Compiler.js68
1 files changed, 36 insertions, 32 deletions
diff --git a/src/Compiler.js b/src/Compiler.js
index c2c56650..472ec625 100644
--- a/src/Compiler.js
+++ b/src/Compiler.js
@@ -139,40 +139,44 @@ Compiler.prototype = {
* @element ANY
* @param {integer|string=} [priority=0] priority integer, or FIRST, LAST constant
*
- * @exampleDescription
+ * @example
* try changing the invoice and see that the Total will lag in evaluation
* @example
- <div>TOTAL: without ng:eval-order {{ items.$sum('total') | currency }}</div>
- <div ng:eval-order='LAST'>TOTAL: with ng:eval-order {{ items.$sum('total') | currency }}</div>
- <table ng:init="items=[{qty:1, cost:9.99, desc:'gadget'}]">
- <tr>
- <td>QTY</td>
- <td>Description</td>
- <td>Cost</td>
- <td>Total</td>
- <td></td>
- </tr>
- <tr ng:repeat="item in items">
- <td><input name="item.qty"/></td>
- <td><input name="item.desc"/></td>
- <td><input name="item.cost"/></td>
- <td>{{item.total = item.qty * item.cost | currency}}</td>
- <td><a href="" ng:click="items.$remove(item)">X</a></td>
- </tr>
- <tr>
- <td colspan="3"><a href="" ng:click="items.$add()">add</a></td>
- <td>{{ items.$sum('total') | currency }}</td>
- </tr>
- </table>
- *
- * @scenario
- it('should check ng:format', function(){
- expect(using('.doc-example-live div:first').binding("items.$sum('total')")).toBe('$9.99');
- expect(using('.doc-example-live div:last').binding("items.$sum('total')")).toBe('$9.99');
- input('item.qty').enter('2');
- expect(using('.doc-example-live div:first').binding("items.$sum('total')")).toBe('$9.99');
- expect(using('.doc-example-live div:last').binding("items.$sum('total')")).toBe('$19.98');
- });
+ <doc:example>
+ <doc:source>
+ <div>TOTAL: without ng:eval-order {{ items.$sum('total') | currency }}</div>
+ <div ng:eval-order='LAST'>TOTAL: with ng:eval-order {{ items.$sum('total') | currency }}</div>
+ <table ng:init="items=[{qty:1, cost:9.99, desc:'gadget'}]">
+ <tr>
+ <td>QTY</td>
+ <td>Description</td>
+ <td>Cost</td>
+ <td>Total</td>
+ <td></td>
+ </tr>
+ <tr ng:repeat="item in items">
+ <td><input name="item.qty"/></td>
+ <td><input name="item.desc"/></td>
+ <td><input name="item.cost"/></td>
+ <td>{{item.total = item.qty * item.cost | currency}}</td>
+ <td><a href="" ng:click="items.$remove(item)">X</a></td>
+ </tr>
+ <tr>
+ <td colspan="3"><a href="" ng:click="items.$add()">add</a></td>
+ <td>{{ items.$sum('total') | currency }}</td>
+ </tr>
+ </table>
+ </doc:source>
+ <doc:scenario>
+ it('should check ng:format', function(){
+ expect(using('.doc-example-live div:first').binding("items.$sum('total')")).toBe('$9.99');
+ expect(using('.doc-example-live div:last').binding("items.$sum('total')")).toBe('$9.99');
+ input('item.qty').enter('2');
+ expect(using('.doc-example-live div:first').binding("items.$sum('total')")).toBe('$9.99');
+ expect(using('.doc-example-live div:last').binding("items.$sum('total')")).toBe('$19.98');
+ });
+ </doc:scenario>
+ </doc:example>
*/
templatize: function(element, elementIndex, priority){