npm install angular2
Sometimes, learning something new is daunting. Angular2 uses ECMA2015 – two new technologies at once for me. Might as well get started!
Absolutely not going to worry about proper HTML headings here. Just going to make a file, load in our angular2, and see if we can get some stuff going.
ooh shivers. Holding off on start.js for now. Alright. So we should be able to… do something. Now what are we supposed to do? Maybe now is a good time to consult the angular docs. Let’s start at the top.
The goal of this quickstart is to write a component in TypeScript that prints a string.
Oh, looks like the 5-minute quick-start isn’t going to be useful, then. Okay, switching to the step-by-step guide.
Winning. Wait, ES5? Why? sigh Let’s find an ES6 guide because, well, that’s what we’re doing right?
How about this ‘Writing AngularJS Apps Using ES6’ guide?
As we will be using ES6 to write the front-end part of the application, we need a transpiler to make the ES6 features understandable for all the browsers. We will be using traceur client side library to compile ES6 script on the fly and run it on the browser.
Alright, let’s get traceur setup. We’ll clone it down and compile.
Guessing we’ll be including that traceur-compiler/bin/traceur.js file in our app in a sec.
Let’s continue the guide.
In the sample code…
The sample code? Where? They’re talking about sample.. oh… it’s all the way down at the bottom. Sample code here.
Looks like first we include angular2, then angular components we want to use (we don’t want to use any, if we can avoid it, to keep this thing simple), then traceur et al.
Sure… let’s try it. Noticing that they have all their stuff in bower_components and, well, we’re just not doing that…
Hmmm looks like this thing is called “bookShelf” – I’d of thought it’d be in title case. Let’s drop that snippet in start.js
Okay, what’s that do? bookShelfModule is the AngularJS module which we get into later, fine. Following along for now, Site Point! Next time, we gain some control with Controllers!
Feel the power.