Sha256: efe0f84d4351105434f6ac2b448a3641b948b3ff38f73953407bc7c1cf4bed63

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

Sprangular.controller "CartCtrl", (
  $scope,
  Cart,
  Account,
  Status,
  Angularytics,
  Env
) ->

  $scope.user = Account.user
  $scope.cart = Cart.current
  $scope.status = Status
  $scope.currencySymbol = Env.currency.symbol

  $scope.removeAdjustment = (adjustment) ->
    Angularytics.trackEvent("Cart", "Coupon removed", adjustment.promoCode())
    Cart.removeAdjustment(adjustment)

  $scope.removeItem = (item) ->
    Angularytics.trackEvent("Cart", "Item removed", item.variant.product.name)
    Cart.removeItem item

  $scope.isEmpty = ->
    Cart.current.isEmpty()

  $scope.empty = ->
    Cart.empty()
    Angularytics.trackEvent("Cart", "Emptied")
    $scope.$emit('cart.empty', Cart)

  $scope.reload = ->
    Cart.reload()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprangular-0.1.0 app/assets/javascripts/sprangular/controllers/cart.coffee