Angular Notes 1 --- Basic study

132 阅读1分钟

1. Folder structure

e2e --- a folder for end to end test

src / assets --- all of the images, icons and static files store here

src / environment --- one for development environment and the other for production environment

2. Fundamentals

2.1 Typescript:

- Strong typing

- Object-oriented features

- compile type errors

- Great tools

features: 

let a:number = 1;
let a:string/ boolean/ any = ...;
let a:number[] = [1, 2, 3];
let f:any[] = [1, "hello", true];

2.2 Angular CLI 

helps to create Angular app, dev tools, deploy the repo, run unit testing

2.3 Server Side Rendering

reduce the rendering time ( reduce from 10s to 1s to show one single page)

benefits to SEO

2.4 Angular Material (Official component library)

3. Core Concepts

3.1 

Component --- An HTML fragment with Logic and data

Module --- includes all components

3.2 How to generate an Angular app?

$ ng new app

How to generate a new component ?

$ ng generate component nav
$ ng g c components/nav

How to start the server?

$ ng serve --open