Ionic2 Beta7 was released May 19, 2016 CHANGELOG
There is an official upgrade guide on the changelog, just scroll down.
This updates Angular to 2.0.0-rc.1 CHANGELOG
Edit: I missed the official guide when writing this post last night. Somehow I just skimmed the changelog and never scrolled down to the guide.
The one thing not mentioned by the official guide that I noticed with my diff, is that index.html changed the order of the lang attribute (moved to the beginning), and meta moved above title. I’m not sure if this is some kind of localization and/or encoding bug fix (does HTML require these to be first?), but I decided to make the changes.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic</title>
Original Post:
This was my approach to updating:
- Create a fresh Ionic2 project with ionic start
- Do a directory diff against your project (in Linux I recommend Kompare or Meld)
Tip: Set your tool to ignore: node_modules/ www/build/ platforms/ plugins/
(You could just skip the directory diff and just compare package.json, index.html, and app.ts) - You should make the following changes:
package.json
Update your dependencies to match the starter project.
rm -rf node_modules
npm install
www/index.html
html lang attribute and meta tag reordered to be first.
Add:
<script src="build/js/Reflect.js"></script>
<script src="build/js/zone.js"></script>
TypeScript files
Change imports to use '@angular/’ instead of 'angular2/'
For example:
import { Injectable } from '@angular/core';
IonicApp.getComponent(‘nav’) seems to be deprecated
Use nav: Nav in your App and nav: NavController everywhere else. (see sidemenu starter project)
ngFor deprecated hash variable syntax
You’ll notice a warning about using let instead of #myvar
Issues
I encountered a TypeScript error relating to Observable.map, and Geolocation.watchPosition().map was no longer present, but that’s the only problem I had.