Starting a new project

If I’m starting a new project, should I start with Ionic 1 or with Ionic 2?
Is Ionic 2 include Angular 2?


Ionic 2 is in alpha, the cli is in beta, is your project personal or professional?, as of now i don’t recomend using angular 2 for anything more than tests or intern product for the company.

Yes, Ionic alpha.42 (current one up to 14/12/2015) ships with Angular 2 alpha.52 (i think).

I’m planing to start a new professional project in the following month and I was thinking maybe it will be easier if I start with Ionic 2.

I wonder if I start with Ionic 1 how hard it will be to migrate to Ionic 2?
I’ve also heard that Angular 2 is completely different than Angular 1, so if I start with Ionic 1 will I be able to upgrade my app?

Thanks again.

There are guides for structuring your code so it looks like angular 2 in some sort, so when you decide to migrate it will be easyer, unfortunatelly it’s not the same for ionic 2, as ionic has it’s own built in directives you will have to create a new project with the new CLI and then start to traduce the directives.

One example is popups, in ionic 1 there could be only one popup on screen, if you tried to open another, the first one would be closed, but in ionic 2 popups weren’t designed the same way, they can stack one over the other (that’s the reason i’m forced to change from popups to modals) and the close function works like if you find the component with jQuery and then remove it, just that with cordova.

If you structure your app thinking in migration in the future, it will be easyer, as most of the logic will be the same, just a different sintax, and the html structure will be alike with a lot more explicit relation with the code.

So what do you think should be a better approach.

  1. Starting as Ionic 1 and later on migrate to Ionic 2
  2. Starting right away as Ionic 2 and make the updates while writing the app

Thanks again!

As it’s for a professional project i won’t recommend it as both Ionic and Angular are in alpha state, i’m currently doing #2, i’m writing a professional app with ionic 2 but the issues keep raising up, for example i updated recently to ionic-framework-2.0.0-alpha.42 and it broke most of the things, this updated shipped with angular-2.0.0-alpha.52 and it came with a lot of breaking changes, now most of tutorials won’t work unless a bit of work is made to adapt the changes, for example:

ng-for turned into ngFor

Most of the ‘-’ where replaced for capital letters in the next word, and until stable release it could keep happening, breaking changes like this one.

Another example is http module, mine was working (with a bit of extra work to notice that http needed an ‘http header’ to let the rest server know that the post was of application/json data type, now i have to troubleshoot why now it doesn’t even send the request.

If it weren’t a professional app i would reccomend as angular 2 enforces best practices and you could learn a lot by digging in the code base to fix issues and report it to the ionic and angular team, but for a professional app that most likely is for a company you work for, it could be more trouble than worth for.

1 Like