当使用yeoman角度生成器时,我目前无法指定路径。
当我yo angular:service ServiceName
时,它会创建测试和脚本目录。
但我只是想指定一个路径并告诉生成器应该保存我的1个服务文件。
任何有类似经历并且能够更好地指导我的人?
答案 0 :(得分:0)
是的,我们可以。只需在项目的根目录中将其保存为.yo-rc.json
{
"generator-angular-fullstack": {
"insertRoutes": true,
"registerRoutesFile": "server/routes.js",
"routesNeedle": "// Insert routes below",
"routesBase": "/api/",
"pluralizeRoutes": true,
"insertSockets": true,
"registerSocketsFile": "server/config/socketio.js",
"socketsNeedle": "// Insert sockets below",
"filters": {
"babel": true,
"js": true,
"html": true,
"sass": true,
"uirouter": true,
"bootstrap": true,
"uibootstrap": true,
"socketio": true,
"mongoose": true,
"auth": true
}
},
"generator-ng-component": {
"routeDirectory": "client/app/",
"directiveDirectory": "client/app/",
"filterDirectory": "client/app/",
"serviceDirectory": "client/app/",
"basePath": "client",
"moduleName": "",
"filters": [
"uirouter"
],
"extensions": [
"babel",
"js",
"html",
"scss"
],
"directiveSimpleTemplates": "",
"directiveComplexTemplates": "",
"filterTemplates": "",
"serviceTemplates": "",
"factoryTemplates": "",
"controllerTemplates": "",
"decoratorTemplates": "",
"providerTemplates": "",
"routeTemplates": ""
}
}