Skip to main content

Ionic 2 - How to update existing Ionic2 Project version

Since the Ionic Team has launched the Ionic2, there has been great buzz about the same. All the mobile developer's are trying there hand on Ionic2.  With Each upgrade few new features and bug fixing were introduced. Now Finally Ionic Team has launched the Ionic2 Release Version. That's a great news, isn't it?


But Now we all have one problem with us. How to update our existing Ionic2 Project's?

We are going to look into the solution for the same.

Update Ionic CLI

Insert the command
npm install -g ionic
in command prompt and Enter


Update Ionic Project Dependencies

Open package.json within your project folder and update the dependencies as shown 
"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.7",
    "ionic-angular": "2.0.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26",
    "sw-toolbox": "3.4.0"
  }

The quickest way of checking package.json will be to look into ionic starter template.
now remove the node_modules folder from ionic project and naviagate to your project location in terminal/command prompt. Once you reach in project root, enter below command
npm install

This will install all the node modules again. Cool, we have now updated our project to latest ionic 2 version. We can build our application now with all latest features and bug fixes for ionic2.


Comments

Popular posts from this blog

Ionic2 - Secure Storage in mobile application

Securing communication between mobile application and back-end server is crucial. We should authenticate the requests sent from mobile applications before serving them. Authentication may require username and password for the user, which most of the developers store into mobile local-storage.  Storing sensitive information in local-Storage is a very bad practice, instead you should use other options such as JWT tokens or Social providers. To get more information look to Security for Cordova mobile applications . An token is also an sensitive information, which we need to store somewhere, so what shall we do? Thank God cordova have such large community support, we will look for one of such plugin which can help us here. Before using plugin, lets first create the blank ionic2 application ionic start --v2 SecureStorageExample blank navigate to the directory of your application  and add the secure storage plugin using the below command ionic plugin add cordov...

Ionic2 - Hammer JS Example

Gesture event support is also one of the reason behind popularity of mobile applications. Capturing gesture events can be easily done in case of native mobile applications, since all the mobile platform expose gesture events in native code. Since Hybrid mobile applications are built over html and  javascript,  html don't support gesture events. There could be scenario's, where you wants to provide support for your hybrid mobile application. In such cases, we can use Hammer.JS  . Angular version 2 also provides support for Hammer.JS, about the same we will look into this post. Let's say we want to design a simple box, which we can rotate in any direction as shown Here we are trying to rotate the box in any direction by using Gesture events. To perform rotation we need to use two fingers. Let's see how we can implement the same in Ionic. Let's create a blank application using command ionic start hammerjsExample blank --v2 Now let's add Hammer.JS ...

Ionic2 - Internationalization using ng2-translate

To target target people from different countries, i18n support is required for your mobile app . Here in India where there are so many local languages, i18n support in mobile apps is must. In This blog, we will look how we can achieve i18n in ionic2 apps. We all know ionic2 is based on angular version 2. New angular version has it's own internationalization(i18n) approach , but sadly this approach is not yet supported in ionic2. Ionic team suggests to use ng2-translate for the internationalization in ionic2. Let's begin with it Create a blank application in ionic2 ionic start --v2 i18Ionic blank navigate to folder i18Ionic in terminal/cmd and install ng2-translate npm package in your ionic project npm install ng2-translate --save Once the npm package is installed, we are ready to configure our application for i18n support. in ng2-translate, we need to create json specific to the languages which we want to support in our code. In this example we will s...