I have a basic controller that displays my products,
$scope.products = data;
In my view I'm displaying this products in a list
<li ng-repeat="product as products">
What I'm trying to do is when someone clicks on the product name, I have another view named cart where this product is added.
<li> //click one added here </li>
<li> //click two added here </li>
So my question here is, how do pass this clicked products from the first controller to the second? I assumed that cart should be a controller too.
I handle click event using directive. Also, I feel I should be using service to achieve above functionality just can't figure how? because cart will be a predefined number of products added could be 5/10 depending on which page the user is. So I would like to keep this generic.