I added a pipe but the pipe doesn't work. This is what I have:
@Pipe({name: 'grandtotal'})
export class GrandTotalPipe implements PipeTransform {
sub_total = 0;
product_price = 0;
quantity = 0;
transform(product_price: number, quantity: number, sub_total: number) {
sub_total = product_price * quantity;
sub_total += sub_total;
return sub_total;
}
}
and in the HTML:
<div>Grand Total {{product_price | grandtotal: quantity : sub_total}}</div>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/7a8837c8-14a8-4a98-b1bc-2a3a7145b42fo%40googlegroups.com.