Using Ionic 2 with the Angular CLI

The easiest way to create and work on an Ionic project is to use the Ionic CLI.

However Ionic 2 is based on Angular 2, so we could say that an Ionic project is basically an Angular project with the Ionic framework added to it. You don’t have to use the Ionic CLI.

Ionic “the framework” is one thing, and the Ionic CLI is another thing. This is an important distinction that people just starting with Ionic frequently seem to miss.

Continue reading

How to use JavaScript 2015 (ES6) now in your Ionic app

ECMAScript 2015 has finally been approved a few days ago. The new JavaScript standard – also known as ES6 – introduces a wealth of new features, from arrow functions and classes to block-scoped variables and modules, and many more.

JavaScript 2015 is a much richer, more modern language that tackles many of the shortcomings of earlier versions and is a lot more fun to work with. Shame that we now need to wait some time before all the major browsers will support the new standard… Or do we?

Well, thankfully we don’t. We can use ES6 right now. There are a few transpilers that can take ES6 code and translate it into ES5 code that happily runs on existing browsers. In this post, I’ll show you how to configure an Ionic project to use the Babel compiler.

Continue reading