How do I change the path for generated files for the generator-angular in yeoman

陌路散爱 提交于 2019-12-12 09:59:13

问题


My question:

From the readme on https://github.com/yeoman/generator-angular

yo angular:controller user

Produces

app/scripts/controllers/user.js

How do I make it produce

app/js/controllers/user.js

What I've looked at:

I don't think I can configure the path since the source shows that the path is hard codded:

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

I've considered forking the project and changing the code, but that feels dirty. I'm hoping that there is a configuration i can change, but there is no github wiki, so I can't exactly RTM to find the configuration options. I tried looking in https://github.com/yeoman/generator-angular/blob/master/script-base.js but that wasn't very helpful either.


回答1:


Unfortunately there is no fix for this right now.

But the good news is that the team is working on a solution for this. See this Twitter conversation.



来源:https://stackoverflow.com/questions/18703293/how-do-i-change-the-path-for-generated-files-for-the-generator-angular-in-yeoman

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!