Ionic 3 basics
Ionic is a mobile framework built on top of AngularJS and Cordova, targeted at building multiplatform mobile apps.
It uses the WebView component on iOS and Android to render it's content and implement functionality. The WebView is then
wrapped in a native application.
Prerequisites
- nodeJS (Download)
- Cordova (
npm install -g cordova)
- Ionic (
npm install -g ionic)
- Android SDK or XCode (only Mac)
Important concepts
- Ionic uses the AngularJS MVC architecture
- HTML, TypeScript (Typescript in 30 minutes) and CSS are used to implement the UI
- Apache Cordova plugins give access to native device functions with JavaScript code
- Ionic CLI (command line interface). This is a NodeJS utility powered with commands for starting, building, running and emulating Ionic applications.
First project
When creating a project, there are a couple of options to choose from :
- Blank app
- Tabs app
- Side menu app
So if you want to create a new project with tabs :
ionic start myApp tabs
cd myApp
Adding a platform :
ionic cordova platform add android
Or :
ionic cordova platform add ios
Running your project in a browser :
Or in the Android emulator :
ionic cordova run android
Or in the iOS emulator :