Saturday, October 29, 2016

Learn Angular 2 fast - a tutorial

Here is a crash course / tutorial in Angular 2 basic concepts. This document will be updated regularly.

Angular 2 is a modern, useful and popular JS framework. It's backed by Google and builds upon the good foundations laid by Angular 1, which is widely used by large software companies.



The basic concepts in Angular 2 are:

Component


Component represents a view. It's a TS class whose properties are going to be renedered as HTML, using the template provided by the component.


Service


Service deals with HTTP REST calls and anything else not directly tied to view.


Router


Router is a class capable of reading URL and its parts.


Directive


Directive is a class which extends HTML tags. For example, we can make an directive called HighlightTextbox, and use it like this in our HTML:

<input HighlightTextbox type='text' />

and this directive would add borders and make fonts larger. Angular 2 comes with tons of built in directives, so make sure you investigate them :)




All these four elements of Angular 2 applications, are simple TypeScript (TS) classes. TypeScript is chosen because it's easy to learn and it supports any standard ES5 JavaScript code.

This tutorial is going to be updated from time to time. Meanwhile, for a hands on tutorial, make sure you check this one on YouTube:

Here is a super cool tutorial, where you are going to build your first Angular 2 REST-based Web application in less than 60min:

Building your first Angular 2 app, cool step by step video

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...