You people already ionic 1.0 has a huge success, one of the main reason for this framework success is it builds on popular framework AngularJS, now the angular team has rewritten their own Angular 2.0 framework from ground up which was now in beta with lot of changes compare to Angular 1.0. So like Angular team ionic has build their own ionic 2 framework is based on Angular 2.
Ionic 2 also now in beta like angular 2 which is also completely rebuild to get better performance and simplified code.
Installing Ionic 2 and dependencies
To install ionic 2 you must have to install node.js, Please download the node.js installer from this link.
Ionic team recommends to install 5x version of node along with 3x version of npm, which will provide stability and speed of building.
Once install the node.js please run the below command line to install ionic 2 beta version.
$ npm install -g ionic@beta
Create template based apps in ionic 2
Let discuss about how to create a ionic 2 application using cli, ionic team provides tutorial template as starter application.
start command is used to create the application and also have to specify –v2 option, ionic 2 application created default as on typescript based application.
$ ionic start myproject tutorial --v2
this above command is used to tutorial template based application, it also provides different templates like tab, blank, sidemenu
$ ionic start myproject tabs --v2
$ ionic start myproject blank --v2
$ ionic start myproject sidemenu --v2
View the ionic application in browser
once you have created the application, next have to view that in browser, just navigate to the created application folder using the below command.
$ cd myproject
then run the below command to view in browser.
$ ionic serve
for example if you are viewing the ionic 2 tabs application template it will looks like below.
Run the ionic application in device
To running the application in device you must need to install platform specific SDK, once you have configured the development platforms please run the below commands.
Run the application in iOS device
$ ionic run ios
Run the application in Android Device
$ ionic run android
Run the application in Windows
$ ionic run windows
For running the application in emulator you have to use emulate command instead run.
$ ionic emulate ios
If you are like debug the application which access native feature you must have to run the application in device.
Ionic 2 Features:
- TypeScript Support
- PWA & Electron Support.
- Best navigation Support
- Ionic native for native plugin access
- Windows universal support
- Best theming support
- Fatest animation support
- Android Material Support
- Excellent documentation
Why have to choose ionic 2?
Ionic 2 taking advantage google progressive web apps (PWA apps), Google has been talking about Progressive Web Apps. These are simply a web apps that give an app-like user experience to users, and are built with web technologies and Ionic 2 is at the fore front of implementing this feature, next one is ionic 2 promised to provide the default electron support.
Overall the ionic 2 provides best improvements in all aspects. 🙂