Everything you need to know about ionic 2 before getting into developing !
I have been a fan of Angular 2 ever since it came out. One reason for that is that they allow you to write Angular 2 with Typescript as well. Those of you who don’t know of Typescript, think of it as an object-oriented version of JavaScript. If you are coming from a Java, C# or any OOP-based language background, you will love this.
So why am I talking about Angular 2 in an article titled ‘Ionic 2’? Well, it being a hybrid mobile application framework, you can write using Angular 2. Annnnd I love that everything can be written on Angular 2 using TS. I’ll now give you a bit of an introduction to the Ionic Framework.
Ionic Framework
Ionic is all about hybrid mobile app development and it has been quite a popular hybrid mobile application since it was launched. Ionic is built on top of the AngularJS and ApacheCordova Platform. You can develop Ionic applications using web technologies such as html, css, sass, etc. — this might be one of the reasons why Ionic caught the attention of the dev world.
So enough jibberish about other things. Let’s get started with what the title says ;)
Ionic 2 — What’s new ?
Photo Source : https://www.pinterest.com/pin/154881674661403188/
Almost everything. New language, new architecture and new everything. Are these changes good? Well let’s talk about that below — for readability, I have divided this into a couple more headings.
- NEW COMPONENTS !
Ionic 2 is packed with plenty of new components and it’s said that it has 100% support on material design as well. Even older components have been optimised and are very easy for any developer to use in their applications. Also, Ionic 2 now has an all new navigation system as well, which I will talk about a bit more in detail in a while. And to add to it all, they have developed powerful new form control components, which evolves stock controls available in the browser.
- Ionic Native
If you have worked with Ionic1 ngCordova you probably know how awesome it was when playing around with native plugins. If you have dug deeper into ngCordova you must aware that it is a wrapper written for Cordova plugins to blend in with Angular-like frameworks by adding support to promises.
By bringing Ionic Native, the Ionic team have replaced the ngCordova plugins. Ionic Native is almost the same as ngCordova but it has been implemented to give better support to Angular 2 by adding promise and observable support. One good thing about Ionic Native is that unlike in ngCordova, you don’t have to do dependency injection or anything to use Ionic Native — you just directly calling the plugin just like calling any other method.
- Error Handling
Imagine because of you own bug that you wrote :p your entire app suddenly freezes? I think previous Ionic 1 users must have experienced this white screen of death. So fortunately, the Ionic 2 team has been able to add run time error catching, which is fascinating.
They have achieved this by adding custom ErrorHandling class to Ionic that tied into App Script Dev Server. Basically if you run into an error, it will show it in a detailed and graphical view. Here is what it looks like:
To read more please visit this link on medium