This article helps you get started with Ionic Framework, the open-source front-end framework for developing hybrid mobile apps with HTML5.
Following will be discussed in the article:
Feel free to add/suggest any points that I may have missed upon.
When you have frameworks like Cordova/PhoneGap or Titanium, why need Ionic in the first place? Well, as I get started with some of these frameworks and got done with Hello World program and wanted to do more, I decided on getting myself expert at developing hybrid apps. The primary reason being the fact that it would require me to know HTML, CSS & Javascript and create cross-platform mobile apps in easy manner without knowing native programming details.
That said, as I started on hybrid apps, I got stuck at following question as using bootstrap to develop UIs for my hybrid apps was not serving the purpose.
I am big fan of Bootstrap framework for Web UI. Its just so powerful and helpful for developing Web UI. However, as I looked on into it, I could not find CSS elements (classes) which would help me to develop native device looking UIs.
This is when I discovered Ionic framework.
So, Why did I decide to choose Ionic framework for next set of hybrid apps?
If you wanted to get on board with Ionic quickly and start having fun creating/developing your next hybrid apps, you may want to learn/have decent knowledge of following:
I am glad that I had a good knowledge of both of above, and it took me know time to get started with Ionic. For that matter, knowing what Angular could achieve, I am excited that I shall be able to develop some real cool hybrid apps in near future with Ionic framework.
You may want to follow instructions on following pages:
http://ionicframework.com/getting-started/
Following are some key softwares/tools that you may need to install/configure for a smooth sail with ionic framework installation:
Once all of above is done, you may follow the instructions on ionic getting started page and get setup with ionic.
If you want to get started with a template project, get hold of ionic base project. For every new project, you could get this installed and get started in a quick manner. The project does contain all dependencies that one may need to get started. Follow the instruction on the above page and get your base project from where you could start developing your apps. You could also follow the instruction below to get started with ionic template project.
After you have installed ionic base project, do the following:
app.js: Write controller code such as following in js/app.js. Append the following code to the existing code
.controller( "HelloCtrl", [ '$scope', function( $scope ) {
$scope.firstname = '';
}])
Thus, the overall code in app.js would look like following:
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
// Set the statusbar to use the default style, tweak this to
// remove the status bar on iOS or change it to use white instead of dark colors.
StatusBar.styleDefault();
}
});
})
.controller( "HelloCtrl", [ '$scope', function( $scope ) {
$scope.firstname = '';
}])
index.html: Write following in index.html in between ion-content tag.
<div class="list" ng-controller="HelloCtrl">
<label class="item item-input"> <input type="text"
placeholder="Type Your Name" ng-model="firstname">
</label>
<h2>Hello, {{firstname}}</h2>
</div>
…
[adsenseyu1]
In recent years, artificial intelligence (AI) has evolved to include more sophisticated and capable agents,…
Adaptive learning helps in tailoring learning experiences to fit the unique needs of each student.…
With the increasing demand for more powerful machine learning (ML) systems that can handle diverse…
Anxiety is a common mental health condition that affects millions of people around the world.…
In machine learning, confounder features or variables can significantly affect the accuracy and validity of…
Last updated: 26 Sept, 2024 Credit card fraud detection is a major concern for credit…