Jaypi Jaypi - 28 days ago 12
AngularJS Question

AngularJS - Move Object from Controller 1 to Controller 2

I'm currently learning AngularJS but I wasn't able to find a solution for this problem even though it seems trivial.

I have two lists / controllers that are getting created by factory service.

I want to remove an object from list 1 and add to list 2. When I display the object in the console after passing it, I can see it but it doesn't appear in my second list.

I have the code on GitHub - As you can see this is an assignment from coursera.
https://github.com/alaimoclaudia/assignment2_solution

Answer

I am not sure I am answering your question, but I have created a plunker based on your github code:
https://plnkr.co/edit/oNvezy5IQ9EBKMpwWq7j?p=preview

I see only one list of items in the code:

[{
  name: "Milk",
  quantity: "10"
}, {
  name: "Donuts",
  quantity: "10"
}, {
  name: "Cookies",
  quantity: "10"
}, {
  name: "Chocolate",
  quantity: "10"
}, {
  name: "Apples",
  quantity: "10"
}];

And it seems like the ui behaves as expected.