首页 > 作文

angular

更新时间:2023-04-03 11:24:02 阅读: 评论:0

cli命怎么磨练意志力令

你可以使用ng generate命令,为已有的 angular 应用程序添加新的功能。

ng generate class my-new-class: 新建 class

ng generate component my-new-component: 新建

ng generate directive my-ne高考时间w-directive: 新建指职校有哪些专业令

ng generate enum my-new-enum: 新建枚举

ng generate module my-new-module: 新建模块

ng generate pipe my-new-pipe: 新建管道

ng generate r安徽宿州学院vice my-new-rvice: 新建服务

ng generate命令与其它的子命令一样,也有快捷键,具体如下:

ng g cl my-new-class: 新建 class

ng g c my-new-蕙质兰心的意思component: 新建组件

ng g d my-new-directive: 新建指令

ng g e my-new-enum: 新建枚举

ng g m my-new-module: 新建模块

ng g p my-new-pipe: 新建管道

ng g s my-new-rvice: 新建服务

其他添加功能用法:

创建带路由的模块ng generate module 模块名 –routing

创建模块下的组件ng generate component 模块名/组件名

创建全局服务ng generate rvice hero –module=app

创建路由控制器ng generate module app-routing –flat –module=app

–flat:不单独创建一个文件夹。只创建文件

–module=app :告诉 cli 把它注册到 appmodule 的 imports 数组中。

运行程序:ngrve –port 8990 –open

–port:表示程序运行的端口号为8990

–open:打开到,访问程序

打包构建程序:ngbuild –prod

–prod:会进行打包优化。打包后的文件体积会小很多,

本文发布于:2023-04-03 11:24:01,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/06498d309d7a846a89726db9e902e9af.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:angular.doc

本文 PDF 下载地址:angular.pdf

标签:模块   程序   组件   命令
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图