This project was generated with Angular CLI version 8.3.20.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
-
node;
-
npm ;
-
npm install @angular/cli -g [@angular/[email protected]]
-
ng new angular-app [select router, css as default];
-
npm run start or ng serve;
-
install Prettier for vs code;
-
install git Angular Essentials
-
Angular constructor src
- main.ts /应用的入口文件 -- AppModule /应用的root模块
-
Input: 父组件传递数据给子组件
-
Output: 父组件监听在子组件上事件
-
Routes: app-routing.module.ts
-
带参数的路由
-
routerLink
-
获取路由参数的值(paramMap)
-
services: 应用的操作方法
-
ng generate module modules/post/post-routing --module post --flat /在post模块下面生成post-routing路由放在module post下面
-
ng generate module modules/demo --routing --module app /生成demo模块以及对应的路由模块 放在app下面
-
ng generate module modules/demo/admin --routing --module demo