angular 基本操作

1.新建项目(带路由)

ng new demo --routing

2.新建组件

  统一放到components目录下(文件夹会自动创建)

ng g component components/home

  在components下新建文件夹 home,并创建四个组件文件

3.新建服务

ng g service services/hero

  不新建文件夹,在hero文件下创建 hero.service.ts

4.新建模块

ng g module mat

  不新建文件夹,在mat文件下创建 mat.module.ts

原文地址:https://www.cnblogs.com/wskxy/p/14242353.html