mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-19 04:49:15 +00:00
Fixing the scope issue
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
Darkswarm.controller "CheckoutCtrl", ($scope, Order, storage, CheckoutFormState) ->
|
||||
|
||||
# We put Order.order into the scope for convenience
|
||||
# However, storage.bind replaces Order.order
|
||||
# So we must put Order.order into the scope AFTER it's bound to localStorage
|
||||
$scope.Order = Order
|
||||
storage.bind $scope, "Order.order", {storeName: "order_#{Order.order.id}"}
|
||||
$scope.order = Order.order
|
||||
|
||||
$scope.CheckoutFormState = CheckoutFormState
|
||||
#$scope.order = Order.order
|
||||
$scope.accordion = {}
|
||||
@@ -15,7 +21,6 @@ Darkswarm.controller "CheckoutCtrl", ($scope, Order, storage, CheckoutFormState)
|
||||
storage.bind $scope, "accordion.payment"
|
||||
|
||||
storage.bind $scope, "CheckoutFormState.ship_address_same_as_billing", { defaultValue: true}
|
||||
storage.bind $scope, "order", {storeName: "order_#{$scope.order.id}"}
|
||||
|
||||
$scope.purchase = (event)->
|
||||
event.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user