I am just blowing my mind. I can't understand how the code below is working.
I have a factory and inside an attribute called "products" and other called "order". Two methods, one called "list()" that returns the "products" attribute, and other called "orderList()" that returns "order". Also, it has a method called "add()" that get a "product" coming from the "products" list and populate the "order" list inside the factory. After that, I have two controllers and two lists. One controller for the products available ("products" attribute) and other for the shopping cart ("order" attribute).
At the beginning of each controller, I have $scope.productsList = Product.list(), and in the other one $scope.productsOrder = Product.orderList().
The products begins with the products list. The order begins empty. That's perfect.
When I click in the +1, those two changes to the "order" list. And have no idea why.
Here is the code: http://codepen.io/anon/pen/lFLbH