Angular 2 tutorials and what not.
Each example in this repository is built from these sources:
$ git clone https://github.com/mitch-b/angular2-playground $ cd angular2-playground/
(this is assuming node and npm are already installed)
# install toolsets and dependencies $ npm i -g tsd@latest $ tsd install angular2 es6-promise rx rx-lite $ npm i -g typescript@^1.5.0-beta
Option 0: Use terminal
$ tsc --watch
> tsc.cmd -w
Option 1: Use Atom +
I've found Atom to be fairly simple to use. With the atom-typescript package, it will compile the
.ts files to
.js every time you save your file. Convenient.
Option 2: Visual Studio Code
I also tested these samples using Visual Studio Code. Seems to work pretty straightforward and was built to handle TypeScript.
- Download Visual Studio Code (Windows/Linux/Mac)
- Open this repo folder in VS Code
- Ctrl+Shift+B (Windows/Linux), ⌘+Shift+B (Mac) will trigger build using
tscsettings found in
When trying this on a clean installation of Ubuntu 15.04, there's may be small changes you'll want to make.
Depending on how you've got node installed, you either have or don't have the
node executable alias.
node executable can be found, since our VSCode build task expects the name
Installing node from apt-get doesn't seem to include this.
Running Ctrl+Shift+B and inspecting the Output window, I saw this message:
/usr/bin/env node No such file or directory.
So, let's fix the missing node link.
$ which node # if you see an entry returned, you don't have this error. Go to VSCode and enjoy! # ... if nothing, try nodejs $ which nodejs # if nodejs is returned, (assuming /usr/bin/nodejs) link it to node $ ln -s /usr/bin/nodejs /usr/bin/node
Use your favorite web server. Example with Python,
# pwd: /path/to/angular2-playground $ python -m SimpleHTTPServer 11337
Now, just navigate your browser to localhost:11337