Wednesday, July 12, 2017

Angular notes

Angular 4 notes

Install Angular and create first project


  1. Install node.js (https://nodejs.org/en/)
  2. npm install -g @angular/cli
  3. ng new my-first-project
  4. cd my-first-project
  5. ng serve
  6. ** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **

Check Node and NPM version 

$ node -v
$ npm -v

Typescript

Install typescript
$ npm install -g typescript
Compile ts file:
$ tsc app.ts

Directives overview

There are three kinds of directives in Angular:

Components—directives with a template. (most common)
Structural directives—change the DOM layout by adding and removing DOM elements. (change the structure of the view e.g. *ngIf)
Attribute directives—change the appearance or behavior of an element, component, or another directive. (are used as attributes of elements e.g. ngStyle)

Ref


No comments:

Post a Comment