How to specify which Ionic and Angular version to use


#1

I want to create a new Ionic project using Ionic 3 and Angular 4. As you know Angular 5 is out and when I create a new project it’s created with the last version of Angular. This is a part of my package.json :

"dependencies": {
    "@angular/common": "5.0.0",
    "@angular/compiler": "5.0.0",
    "@angular/compiler-cli": "5.0.0",
    "@angular/core": "5.0.0",
    "@angular/forms": "5.0.0",
    "@angular/http": "5.0.0",
    "@angular/platform-browser": "5.0.0",
    "@angular/platform-browser-dynamic": "5.0.0",
    "@ionic-native/core": "4.3.2",
    "@ionic-native/splash-screen": "4.3.2",
    "@ionic-native/status-bar": "4.3.2",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.0-rc.4",
    "firebase": "^4.6.2",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18"
  }

#2

Why do you want to use Angular 4 instead of 5?


#3

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@4.0.0 or you can mention the version code you want to install


#4

I’m not yet familiar with Angular 5 and I dont know if something changed or not.


#5

There are very few breaking changes in Angular 5. I suggest you give it a try. Most probably there won’t be any changes in your code when going from Ionic 3.8.x + Angular 4.x.x to Ionic 3.9.x + Angular 5.x.x. The most significant change is probably the upgrade to rxjs 5.5.2 but again the code should still work without any changes.


#6

Thank you so much. I will give it a try :wink: