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.
In this first part we see how to write a first Angular 2 Component, and introduce the concepts of Template, Metadata, HTML Plus, and the bootstrap method.
You can download the starting project mentioned in the video here: hello-world-0.zip
Interested in my upcoming full course on Angular 2? Pre-register here.
With Angular 2 now in beta, it’s definitely time to start playing with it. One of my first questions was: what language to use? The first example in the Angular 2 website says
While this example uses TypeScript, Angular works equally well with ES5, ES6 and Dart as well.
So, is it actually possible to write Angular 2 components in “pure” ES6, with code similar to the TypeScript examples but without types and decorators?
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.