angular.directive.ng:eval-order

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

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

Dependencies

Usage

<ANY ng:eval-order="priority">
   ...
</ANY>

Parameters

Example

try changing the invoice and see that the Total will lag in evaluation

<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>