Dumping OrderCycle data via :javascript tags instead of ng-init, Angularising the selector stuff

This commit is contained in:
Will Marshall
2013-12-18 17:05:47 +11:00
parent 1f012dc52c
commit b3a4d826b8
4 changed files with 18 additions and 9 deletions

View File

@@ -1,9 +1,7 @@
Shop.factory 'OrderCycle', ($resource, Product) ->
Shop.factory 'OrderCycle', ($resource, Product, orderCycleData) ->
class OrderCycle
@order_cycle = {
order_cycle_id: null
}
@order_cycle = orderCycleData
@push_order_cycle: ->
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, ->
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, (order_data)->
OrderCycle.order_cycle.orders_close_at = order_data.orders_close_at
Product.update()