angular 常用命令

ng new 项目名   ----------新建一个项目

ng new 项目名 --routing --------新建一个带路由的项目(在项目下会生成一个app.routing.module.ts文件)

ng g component  ---------在项目内新建一个组件

ng g service        ---------项目内新建一个服务

ng g pipe 路径     ---------项目内新建一个管道(在angular中管道的作用类似Java中的比较工具,比如dateformat stringformat)


-------创建一个服务器项目步骤-------------

step1.新建一个空文件夹

step2.执行npm init -y(会创建package.json)

step3.执行 npm i引入node的类型定义文件

step4.创建tsconfig.json文件(告诉编译器如何将typescript编译成javascript)

step5.在编辑器(如webstorm)中设置使用tsconfig.json文件

       5.1 打开preference -->language&reameworks -->typescript -->设置compiler


猜你喜欢

转载自blog.csdn.net/qq_40719649/article/details/80494727