Initialise new Ionic 2 project (not v3 or v1)?



Ok, so I’ve tried to initialise new Ionic projects using the following CLI commands:

  1. $ ionic start appname blank
  2. $ ionic start appname blank --v2

However, the first one generates an Ionic 1 project, and the second one generates an Ionic 3 project (with @IonicPage() etc.).

So my question is, how can I generate an Ionic 2 project, i.e. a project running Angular 2 and lacks the new @IonicPage() decorators etc. introduced in Ionic 3)?



There is no Ionic 2 or 3. It is just Ionic.
Why do you want to run Ionic 2.x release and not the actual one?


This also indicates that you are not using the most current version of Ionic CLI. v2.2.3 would require a --v1 to generate a Ionic v1 project and no param to generate a current version Ionic project.


I’ve been teaching a one-semester course on cross-platform mobile development, and we’ve been using Ionic for the technical parts of the course. However, we haven’t had the time to cover the new changes to the framework and CLI-generated code base. As their exam is being released any day now, it would be beneficial for the students to do their exams using a generated code base (“ionic 2”) they’re already familiar with.

So, by choice we’ve stayed away from upgrading our projects and our CLIs :slight_smile:


Ok, that’s the first time we hear a good reason for this :wink:

Easiest way is to just copy a project that was created with the versions you want. So for example go for the first checkin in the Git repo or something like that.

(But please note that the Ionic Documentation then will probably not what you are seeing, especially not for Ionic Native or other fast moving and developing parts)


Ok – good point! I’ll take this into consideration, might make tomorrow’s lesson into a quick introduction to the new concepts instead of the original plan :slight_smile:



Note that one can (and I do) use framework v3 without any of the @IonicPage lazy loading. It would probably be beneficial for your students to eschew the generators, so that they get familiar with how to build parts of the application by hand. As long as you avoid the generators, you don’t even need to know of the existence of @IonicPage, and your lesson plan material can be used unchanged.