博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
用MeanJS和Yeoman生成器生成【翻译】
阅读量:6758 次
发布时间:2019-06-26

本文共 2535 字,大约阅读时间需要 8 分钟。

One of my favorite things with Yii is the Gii (Generator).

关于Yii(php框架)我喜爱的事情之一是Gii(生成器)Global Information Infrastructure。

 

With a few clicks I could simply add a few Models/Controllers/Views (or all of the above), then build/customize those.

我只需要点击几次就可以添加一些模型/控制器/视图(或者这三个一起),然后就可以构建/定制他们了。

 

MeanJS uses the Yeoman/Yo generator to make this happen. After installing Yeoman generator (which I believe we already installed when we installed MeanJS) via:

 MeanJS 使用Yeoman/Yo生成器让这个变为可能。安装了Yeoman生成器之后(我相信在我们安装MeanJs的时候我们已经安装了) 通过:

npm install -g yo
Now to install the MeanJS generator package: 现在开始安装MeanJs生成器的包:
npm install -g generator-meanjs

(remember, often when running npm install -g you’ll need to sudo it)

(记住,当执行npm install -g 命令的时候,经常你需要用sudo提升权限来执行(linux里的命令))

Basic CRUD

基本的CRUD

For those who are not familiar with the concept, CRUD stands for – Create, Read, Update & Delete.

 对于那些不熟悉这些概念的,CRUD就是 新增,读取,更新 和删除。

These are the basics one needs to present & manipulate data on a website, and a lot of web frameworks generate CRUDs as sort of a first-step.

这些是网站上基本的需求来呈现和操纵数据,并且很多web框架把生成CRUDS 作为第一步。

Let’s create our first CRUD:

让我们创建我们的第一个CRUD:

yo meanjs:crud-module firstmodule
yo meanjs:crud-module firstmodule

After selecting the supplemental folder to include in the Angular Module, and whether or not the module should be added to the menu, a bunch of files are generated.

选择补充文件夹包括进Angular模块,并且这个模块是否应该被添加到菜单里之后,一堆文件生成出来了。

Very Important: The crud-module generates both the Server side & Client files.

非常重要:这个crud模块生成包括服务端和客户端文件。

The Module Structure was explained thoroughly onBasics of MeanJS.

这个模块结构被基于的MeanJs 解释的很彻底。

The crud-module is the all encompassing, there are also sub generators:

这个crud模块是全包括,并且包含了子生成器:

  • angular-module
  • angular-route
  • angular-controller
  • angular-view
  • angular-service
  • angular-directive
  • angular-filter
  • angular-config
  • angular-test
  • express-model
  • express-controller
  • express-route
  • express-test

Those names are pretty self explanatory, so I don’t see much need to go deeper there.

More information about Yeoman generator specifically used for MeanJS can be found

As you can probably notice, this article came out a bit shorter than expected, this is mainly due to time constraints.

I’d like to continue and develop under MeanJS, as I see a lot of interest on the subject.

There are also a few other frameworks that I started reading about that might be a part of some future articles (some are fairly similar).

Bonus info: MeanJS was on the  , very cool.

转载于:https://www.cnblogs.com/yangzhx/p/4350648.html

你可能感兴趣的文章
操作redis方法
查看>>
C语言函数
查看>>
Python3-异常处理
查看>>
Python-简单打印进度条
查看>>
【02】天气查询应用(第二课)
查看>>
监听微信返回按钮
查看>>
第二次实验报告
查看>>
HDU ACM 3790 最短路径问题
查看>>
python生成器
查看>>
linux 安装 ftp
查看>>
python 监控FTP目录下的文件个数
查看>>
MapInfo格式转arggis格式
查看>>
Network - SSL/TLS的基本概念
查看>>
python学习之老男孩python全栈第九期_day012知识点总结
查看>>
pandas学习(数据分组与分组运算、离散化处理、数据合并)
查看>>
geeksforgeeks-Array-Rotate and delete
查看>>
Shell if else
查看>>
iOS之 block,代替代理作为回调函数
查看>>
Linux信号(signal) 机制分析
查看>>
【iOS开发-59】LOL案例:单组tabView、alertView样式、实现监听,以及用reloadData数据刷新...
查看>>