Transition from ionic to ionic 2

So, I just had the possibility to download and test ionic v2 and actually fell in love with it.
I noticed also that basically all changed, so:
which are the best ways to pass from version 1 to version 2?
What should I do to migrate my actual app (tab app with a lot of plugins and remote file downloads) from ionic 1 to ionic 2?
Any advice and/or tip?

Good job though, that new version is really impressive.

Hello there,

I recently had to upgrade one of my apps from Ionic/Angular 1 to Ionic/Angular 2.

  1. Services / Factories
    I created a folder and named it providers. This folder had multiple classes that will act as my service or factory. I copied all the code that I had inside my previous service and pasted it there. Then I start from top to bottom, and convert all the JS or Angular1 syntax to TypeScript and Angular2.

  2. Controllers
    In Angular 2 controllers aren’t really called controllers any more. When you create a page it comes with a class. Inside that class you need to put all your previous controller code and change any syntax to Angular/Ionic 2. Anything variable that is stored with a $scope. prefix will need to change to this.

–

  • You need to know the basics of Angular 2 to be able to migrate efficiently. If you haven’t gotten yourself familiar with it yet then I recommend watching an intro video on YouTube.
  • Migrating will really help you understand Angular 2 and Ionic 2 because throughout the process you will learn the equivalent replacement of every code you had.

Let me know if you had any specific questions or needed additional details to my explanation above.

1 Like

I would absolutely recommend taking a look at the Conference app and working through it to see how the app is structured - pages, providers etc. That has really helped me move from Ionic 1 to Ionic 2.

Do you have a recommended Angular2 video in mind ?

This guy is good…recent video and straight to the point.

Thank you all for your replies, I will check the video and the conference app (that looks amazing!) while waiting for ionic 2 to go on release/stable.