June 20, 2016

Ionic 2 use NavController in Service to show Alerts

Usually you inject Nav:NavController into your classes constructor to use it:

But if you are working in a service you will receive the following error:

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

Avatar photo

theCodeCampus
Developer at thecodecampus </>


June 2, 2016

Ionic 2 set Focus of Input Element

Playing around with Ionic 2 i came to the following issue. I had a component where i’d like to automatically set the focus of an element after the view is loaded completely. The approach is similar to the AngularJS/Ionic1 one. We create a directive. But instead of using jQuery or jQuery Lite to set the […]
READ MORE

Avatar photo

theCodeCampus
Developer at thecodecampus </>