NG-ALAIN

NG-ALAIN

一个基于 Antd 中后台前端解决方案,提供更多通用性业务模块,让开发者更加专注于业务。
NG-ALAIN 是一个企业级中后台前端/设计解决方案脚手架,我们秉承 Ant Design 的设计价值观,目标也非常简单,希望在Angular上面开发企业后台更简单、更快速

前序准备

环境:node, git
技术栈:基于 Typescript、Angular、g2、@delon 和 ng-zorro-antd

安装步骤

安装全局cli脚手架
npm install -g @angular/cli@9.x
创建项目
ng new my-project --style less --routing
初始化配置
cd my-project
ng add ng-alain //ng add 构建空的脚手架
启动服务
npm start
或:运行项目
ng serve --port 0 --open


克隆代码

git clone --depth=1 https://github.com/ng-alain/ng-alain.git my-project
cd my-project
yarn
npm start //启动项目

构建

构建一个空的NG-ALAIN项目
ng add ng-alain

快速生成模板代码
ng generate ng-alain:[command name] [name] [options]
或ng g ng-alain:[command name] [name] [options]
1)Module 模块

例如:构建一个系统模块
ng g ng-alain:module sys

2)业务页
目前包含的业务组件页,包括:

  1. empty 空白页
  2. list 列表页
  3. edit 编辑页
  4. view 查看页
  5. curd 列表、编辑、查看

例如:在sys下生成log列表页:
ng g ng-alain:list log -m=sys
注意: -m 是必须指定的,因为 ng-alain 认为页面应该在某个具体的模块里

多级写法:
例如:在log 组件下有view查看页面
ng g ng-alain:view view -m=sys -t=log

全局配置项

在根注入器中根据注入令牌 ALAIN_CONFIG 提供一个符合 AlainConfig 接口的对象

构建

npm run build

原文地址:https://www.cnblogs.com/sxhlf/p/13955365.html