June 20, 2016
Ionic 2 use NavController in Service to show Alerts
Usually you inject Nav:NavController into your classes constructor to use it:
1 |
constructor(private Nav:NavController) {} |
But if you are working in a service you will receive the following error:
1 |
No provider for NavController! (ExampleService -> NavController) |
If you want to show alerts from within a service you are required to use the NavController. To do so simply create the private field nav with type NavController. […]
READ MORE