Source Freeze

  • Home
  • iOS
  • Swift
  • Cross-Platform
  • About
  • Contact
Home » Ionic 2 getting started

Ionic 2 getting started

August 18, 2016 by Source Freeze Leave a Comment

Ionic framework has quickly emerged as one of the leading mobile app development framework using HTML5, CSS and JavaScript that UI and it is looks like native user interface components. It targets multiple platforms like Android, iOS and Windows Phone with single code base so web application developers can easily create their own mobile apps with existing skills .

ionic 2

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 2 tabs template

$ ionic start myproject tabs --v2

ionic 2 blank template

$ ionic start myproject blank --v2

ionic 2 sidemenu template

$ 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.

ionic 2 tab template

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.

Important Note:

Cordova team created the best document to install android, iOS & Windows platform specific dependencies.

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. 🙂

Filed Under: ios-tutorial

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to Generate random numbers in JavaScript
  • How to Scroll to an Element in a React Component?
  • How to get a Date without the Time in JavaScript
  • How to modify url without reloading the page using javascript
  • How to disable server side rendering in nextjs
  • How to get a file type from URL in JavaScript

Recent Posts

  • How to Generate random numbers in JavaScript
  • How to Scroll to an Element in a React Component?
  • How to get a Date without the Time in JavaScript
  • How to modify url without reloading the page using javascript
  • How to disable server side rendering in nextjs
  • How to get a file type from URL in JavaScript

Recent Comments

    Tags

    beginner colon cross-platform es6 function html ionic iOS javascript mobile application development nextjs objective-c swift switch ternary typescript uiwebview Visual Studio plugin web developer

    Copyright © 2025 Source Freeze