@reedrichards wrote:
I have to listen to the
resume
event and to do so I’ve to subscribe to thedocument
(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