<div ng-controller="CartController">
<div ng-repeat="item in items">
<span>{{item.title}}</span>
<input ng-model="item.quantity">
<span>{{item.price | currency}}</span>
<span>{{item.price * item.quantity | currency}}</span>
</div>
<div>Total: {{totalCart() | currency}}</div>
<div>Discount: {{bill.discount | currency}}</div>
<div>Subtotal: {{subtotal() | currency}}</div>
</div>
上述代碼中的|
- 它有什麼作用?管道在這個AngularJS表達式中做什麼
看一看[角過濾器](http://code.angularjs.org/1.1.5/docs/導向/ dev_guide.templates.filters)。 – dmahapatro