angular.js example in backbone.js and/or knockout.js


I'm comparing these frameworks to do some calculations on the client side. I really liked the example on the angular.js site. I was wondering if any of the backbone.js or knockout.js experts on the site would please recreate that example in their respective frameworks.

Here is the JSFiddle for it.

Code of the Fiddle:

<table ng:init="invoice= {items:[{qty:10, description:'gadget', cost:9.95}]}">
  <tr ng:repeat="item in invoice.items">
    <td><input name="item.qty" value="1" size="4" ng:required ng:validate="integer"></td>
    <td><input name="item.description"></td>
    <td><input name="item.cost" value="0.00" ng:required ng:validate="number" size="6"></td>
    <td>{{item.qty * item.cost | currency}}</td>
    <td>[<a href ng:click="invoice.items.$remove(item)">X</a>]</td>
    <td><a href ng:click="invoice.items.$add()">add item</a></td>
    <td>{{invoice.items.$sum('qty*cost') | currency}}</td>

  Workaround for jsfiddle to pass in ng:autobind
<script src="" ng:autobind></script>

table th {
  font-weight: bold;
table td {
  padding: 0.3em;
By : aa_memon


Here you go for knockoutjs >

I might be biased but it's a lot more structural than angular/backbone.

If you have any questions, let me know.

There are some NaN checks which I think you could take yourself.

By : neebz

This video can help you solving your question :)
By: admin