如何使用角度yeoman生成器在具有路径规范的Laravel项目中创建特定文件?

时间:2015-08-09 19:37:25

标签: angularjs laravel yeoman

当使用yeoman角度生成器时,我目前无法指定路径。

当我yo angular:service ServiceName时,它会创建测试和脚本目录。

但我只是想指定一个路径并告诉生成器应该保存我的1个服务文件。

任何有类似经历并且能够更好地指导我的人?

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": ""
  }
}