Install Angular and create first project
- Install node.js (https://nodejs.org/en/)
- npm install -g @angular/cli
- ng new my-first-project
- cd my-first-project
- ng serve
- ** 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)
No comments:
Post a Comment