Dependency Injection on a Popover

Hi all,

I have an authentication service which I inject in App.ts so I only have one instance of this service throughout my app.

Injecting this service into Page components works as expected but when I inject the service into a popover component, I am getting a new instance of my authentication service.

Can someone please explain to me why this is happening and is there any workarounds?



Just to make it more clear would you provide a sample or snippet of the issue.


Thanks for your reply.

When I have a chance, I will create a simple app to demonstrate but essentially it seems when you inject a service into a popover, a new instance of that service is created. If I treat the popover like a normal component and push it onto the Navigation Controller, a new instance of the service is not created.

Again, when I have more time, I will create an example.


This problem no longer occurs with ionic 2 rc0. Providers are now truly singletons :slight_smile:

I am having this problem in RC4. Is there some trick to get dependancies into a page passed into a popover?