ember.js - Finding the number of records returned from a conditional statement in ember -
i have unless condition , want find out number of records satisfies unless condition.
can or not in ember?
edit:
{{#each model.orderparts |newcart|}} {{#unless newcart.isgeneric}} <div class="card-wrapper col-lg-12 col-md-12"> <div class="col-lg-2 col-md-2"> <div class="order-id">{{newcart.partnumber}}</div> {{#if (gte newcart.promiseqty newcart.quantity)}} <div class="order-status delivered">{{env.app.stockavailable}}</div> {{else}} {{#if (gt newcart.promiseqty '0'(and (lt newcart.promiseqty newcart.quantity)))}} <div class="order-status delivered">{{env.app.lowinstock}}</div> {{else}} {{#if (eq newcart.promiseqty '0')}} <div class="order-status delivered">{{env.app.outofstock}}</div> {{/if}} {{/if}} {{/if}} </div> <div class="col-lg-3 col-md-3"> <div class="item-header">delivery date</div> <div class="item-data">{{newcart.deliverydate}}</div> </div> <div class="col-lg-2 col-md-2"> <div class="item-header">required qty.</div> <div class="item-data"> {{increse-required-quantity incresedquantity=newcart.quantity}} </div> </div> <div class="col-lg-2 col-md-2"> <div class="item-header">unit price</div> <div class="item-data">{{newcart.unitprice}}</div> </div> <div class="col-lg-2 col-md-2"> <div class="item-header">total price</div> <div class="item-data">{{newcart.parttotalprice}}</div> </div> {{/unless}} {{/each}}
what want find out number of records satisfy condition
genericfalsecount: ember.computed.filterby('model.orderparts','isgeneric',false)
the above computed property give count.
Comments
Post a Comment