diff options
| author | Misko Hevery | 2010-11-12 15:16:33 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-11-15 10:04:17 -0800 |
| commit | 7e6f9992216157a10a64a86fe526f61f9f57e43f (patch) | |
| tree | e172da3909e44e8eb9a80eb86880fbb9cd814290 /src/Compiler.js | |
| parent | 625cc7609cfd1a0a4fcecfd55875e548518a72a8 (diff) | |
| download | angular.js-7e6f9992216157a10a64a86fe526f61f9f57e43f.tar.bz2 | |
added remaining directives and search box.
Diffstat (limited to 'src/Compiler.js')
| -rw-r--r-- | src/Compiler.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Compiler.js b/src/Compiler.js index b0210247..680ead11 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -109,6 +109,57 @@ Compiler.prototype = { }; }, + + /** + * @ngdoc directive + * @name angular.directive.ng:eval-order + * + * @description + * Normally the view is updated from top to bottom. This usually is + * not a problem, but under some circumstances the values for data + * is not available until after the full view is computed. If such + * values are needed before they are computed the order of + * evaluation can be change using ng:eval-order + * + * @element ANY + * @param {integer|string=} [priority=0] priority integer, or FIRST, LAST constant + * + * @exampleDescription + * 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'); + }); + */ + templatize: function(element, elementIndex, priority){ var self = this, widget, |
