问题
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