【发布时间】:2013-09-24 00:48:26
【问题描述】:
我的问题:
来自https://github.com/yeoman/generator-angular的自述文件
yo angular:controller user
生产
app/scripts/controllers/user.js
如何让它产生
app/js/controllers/user.js
我看过的内容:
我不认为我可以配置路径,因为源显示路径是硬编码的:
Generator.prototype.createControllerFiles = function createControllerFiles() {
this.appTemplate('controller', 'scripts/controllers/' + this.name);
this.testTemplate('spec/controller', 'controllers/' + this.name);
this.addScriptToIndex('controllers/' + this.name);
};
https://github.com/yeoman/generator-angular/blob/master/controller/index.js#L22
我考虑过分叉项目并更改代码,但这感觉很脏。 我希望有一个我可以更改的配置,但是没有 github wiki,所以我不能完全 RTM 找到配置选项。我尝试查看https://github.com/yeoman/generator-angular/blob/master/script-base.js,但这也不是很有帮助。
【问题讨论】: