Ionic 2.3.0 w/Angular 4.0.0

I updated my app’s package.json and rebuilt. Things seem to be working. No warnings or errors.

Is this safe to do? Am I just lucky that this is working or should I be trying to run Ionic 3.x w/Angular 4?

package.json:

"dependencies": {
    "@angular/cli": "1.0.0",
    "@angular/common": "4.0.0",
    "@angular/compiler": "4.0.0",
    "@angular/compiler-cli": "4.0.0",
    "@angular/core": "4.0.0",
    "@angular/forms": "4.0.0",
    "@angular/http": "4.0.0",
    "@angular/platform-browser": "4.0.0",
    "@angular/platform-browser-dynamic": "4.0.0",
    "@angular/platform-server": "4.0.0",
    "@ionic-native/core": "3.2.4",
    "@ionic-native/google-analytics": "3.2.4",
    "@ionic-native/status-bar": "3.2.4",
    "@ionic/storage": "2.0.1",
    "angular2-cookie": "1.2.6",
    "del": "2.2.2",
    "gulp": "3.9.1",
    "gulp-cli": "1.2.2",
    "ionic-angular": "2.3.0",
    "ionicons": "3.0.0",
    "run-sequence": "1.2.2",
    "rxjs": "5.2.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.5"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.2.1",
    "@types/jasmine": "2.5.46",
    "@types/node": "7.0.11",
    "codecov": "2.1.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.5.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-jasmine": "1.1.0",
    "karma-mocha-reporter": "2.2.3",
    "karma-remap-istanbul": "0.6.0",
    "ts-node": "3.0.2",
    "tslint": "4.5.1",
    "tslint-eslint-rules": "3.5.1",
    "typescript": "2.2.1"
  },
1 Like

I have been similarly lucky so far. There are still some <template> elements in the framework code (like in Alerts), but I don’t think they’re anything to worry about and will probably get fixed soon.

Why do you have angular/cli as a dependency? I don’t. Do you use it for anything Ionic-related?

Thanks very much, this is good information to know. You guys have a lot of courage to update to Angular 4 so soon after the recent release. Personally, right now, I don’t have the courage to move to Angular 4 just yet. Just in the past few days I moved to the new Ionic CLI 3 Beta 4 and some things aren’t working as expected - although it is a lot faster than the current CLI 2.2.1.

Please keep us up to date if you guys run into any problems with the new Angular 4 branch.

I use it for bringing in testing, although I believe the folks involved in here are attempting to obviate that.

Thakns @rapropos. I was wondering if @morrisonbrett used it with karma or something. But yes, I saw that unit testing thread. Pretty exciting if it pans out.

I have both the angular CLI and the firebase CLI installed on my Node. But I don’t have either in my Ionic build process, even though I use both Angular and Firebase in Ionic projects. It seemed like a different animal, but I might be wrong. If it’s just for testing, then maybe I don’t have to worry about it.

I initially tried following Josh Morony’s strategy for adding unit testing support to Ionic projects, but was unable to get it to work. So I decided to go the other way around, allowing angular-cli to generate the project and then grafting the ionic bits onto it. I had much better luck with this strategy, but naturally YMMV.

1 Like

That’s good to know, thank you.

I had a really tough time trying to migrate from angular-cli to @angular/cli for unit testing + code coverage. I couldn’t find a working example and spent WAY TOO MUCH time in karma.conf.js before deciding it’s something I’ll tackle later and reverting back to angular-cli. I’m not the type of person to EVER revert. I always press on. This was an exception.

Where are the instructions to move to ionic-cli 3.x? Is it something like npm install @ionic/app-scripts@beta?

Now that it’s gone 1.0 GM, there are pretty detailed migration instructions here.

Nice one. Happy to read about your experience that there nothing breaking issues for you. I will too try this

Instructions to moving to the Ionic CLI 3 Beta 4 is found in the blog post here:

As I mentioned earlier though I’m having issues with the ionic upload command line with the CLI 3 Beta 4 as I posted here.

I still haven’t had any replies to this thread yet… hopefully someone has some ideas about this soon.

~ Brad

1 Like

Thanks. That’s helpful. However, this explains how to use ionic-cli 3.0 Beta, what about Ionic 3 beta? The one with built in Angular support? What’s the procedure for installing that? I generated a new app via the ionic-cli Beta 3 and the package.json generated looks like an Ionic 2.2 project.

Ionic 3 bets has not yet been publicly announced as ready to use (as far as I know) - therefore I’m not using it yet. I’m still building for the Ionic 2.x code base. There is a forum post about how to install it though, which can be found here:

1 Like