generator-webbp
Yeoman generator
Getting Started
npm install -g yo
Yeoman Generators
Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.
To install generator-webbp from npm, run:
npm install -g generator-webbp
Finally, initiate the generator:
yo webbp
子命令
- 单步生成controller
yo webbp:controllers detailaboutcontact
亮点:可以嵌套,此命令会生成如下文件
|controllers |detail |about.js |contact.js detail.js
另外detail.js中会自动加载about.js及contact.js
- 单步生成views
yo webbp:views detailaboutcontact
亮点:可以嵌套,此命令会生成如下文件
|views |detail |about.html |contact.html detail.html
- 单步生成routes
yo webbp:routess detailaboutcontact
亮点:可以嵌套,此命令会生成如下文件
|states |detail.js
其内容是:
亮点:通过运行此命令,会自动生成 routes(用的是ui-router,目录是states目录),view,controller。有没有觉得很爽的感觉。
License
MIT