Add items to a list with a 'Popover' component in Ionic 2

Hi and thanks to everyone in advance for your help.

I’m pretty new to Angular/Ionic 2, and having a bit of trouble figuring out how to accomplish the following:

I need to show a ‘Popover’ with with a list of items to add to the main view, I can’t figure out how to update the ‘items’ property in the HomePage from the PopoverView to add the item to the ‘items’ property as well as append the new item to the HomePage view. Any help on how to accomplish this is greatly appreciated.

I have created a Plunker demo to show what I mean.

I would bank the items in the popover, and then add them to the HomePage in an onDismiss handler when the popover is closed. See this topic for sample code.

Hi, I know its a bit late but I wanted to test some other options before replying…

Thanks for the suggestion, but I needed to show the items in realtime when an item on the popover was chosen.

I ended up using ionic’s events to publish popover events and then listen for those changes on the HomePage and update the ‘items’ array that way… which shows the items immediately.

I created a new Plunker demo to show how I did it: