AngularJS calculator for finding total value of shopping cart with a given discount amount