[Ionic 4] Get data in modal passed with componentProps

NavParams are no longer supported in Ionic v4 - you will get a static injector error.

In your receiving Component, you need to use the @Input annotation on the variable name, as described in this post:
https://stackoverflow.com/questions/52012447/ionic-4-how-to-retrieve-data-passed-to-a-modal, and then you’ll be able to access the passed in value in your Component’s ngOnInit method.

1 Like