Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

document.addEventListener event resume provider undefined

$
0
0

@reedrichards wrote:

I have to listen to the resume event and to do so I’ve to subscribe to the document (this.platform.resume doesn’t work in this case, full story https://forum.ionicframework.com/t/camera-plugin-restart-app-on-android-8-1)

Unfortunately doing so, I could properly catch the event but in the method I want to use/call, the providers are undefined

Do I code something wrong? Do you see any mistake in my code? Any idea how to solve this?

I would need the provider in the method called by the resume event, because of course, I’ve to process the result…

Thx in advance for the help

constructor(private platform: Platform, public myService: MyService) {
    platform.ready().then(() => {
       document.addEventListener('resume', this.myMethod, false);
    }
}

myMethod(event:any) {
  console.log(event); // => Ok I've got what I need
  console.log(this.myService); // => Undefined
}

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>