I currently have a cart for shopping.
The code for the "add to cart" function looks something like this (shortened):
"add" : function(code) {
codes.push({
"id" : code.id,
"order" : "N/A",
"name" : code.name,
"code" : code.code,
"image" : code.image,
"custom_made" : 0,
"quantity" : 1
});
this.store();
}
}
Currently, I am adding an option for customers to reorder their items in the cart. To achieve this, I am using ui-sortable. It allows clients to drag and drop products to arrange them as they prefer.
Now, I need to save that customized order within the product array itself.
I want to capture the $index used by the ng-repeat directive and save it using a similar function as above, but storing the $index in the code.order object.
Is there a way to accomplish this? I have searched extensively but have not found a method of accessing the $index outside the ng-repeat directive.