angularjs - 修改 Yeoman Angular 生成器以使用应用程序以外的文件夹

标签 angularjs yeoman yeoman-generator

我有一个现有的项目,其目录结构如 public/angular/。但在 Angular 生成器中,一切都转到 app 。我如何修改该行为并自定义它? .对于初学者来说,我只是想将应用程序文件夹更改为 public/angular/

我首先尝试更改

 this.env.options.appPath = 'public/angular';

但这会导致不稳定的行为,导致某些文件进入 public/Angular 并保留在 app/中。目前,bower_components 和 View 以及其他(404.html 和 favicon.ico)卡在 app/rest 中,位于 public/angular

最佳答案

对于 Bower&yo 的当前版本,这需要在以下位置进行更改:

  • .bowerrc: "directory": "app/bower_components""directory": "public/angular/bower_components"
  • .gitignore:app/bower_componentspublic/angular/bower_components
  • bower.json:添加属性:"appPath": "public/angular" ( https://github.com/yeoman/generator-angular#output )
  • karma.conf.js:所有 apppublic/angular

如果您是从头开始,请在调用 $ yo angular 后将 app 文件夹移动到 public/angular

关于angularjs - 修改 Yeoman Angular 生成器以使用应用程序以外的文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20401110/

相关文章:

c# - 在 header 中传递 token 以在 MVC 和 Web API 中进行身份验证

javascript - 让 Grunt 使用 HTML 任务创建新文件而不是重写

node.js - yeoman |哟命令未找到

yeoman - 如何全新安装 Yeoman?

javascript - 选项 beginAtZero 在 angular-chart.js 中不起作用

javascript - ionic : http post request works in browser but not in mobile

javascript - 如何使用 Yeoman 检查目录是否存在?

node.js - yeoman 生成器中的 ComposeWith 不发出结束事件,因此不驱动 'on' 方法

yeoman - 强制覆盖文件

java - 休息 Angular 和图表 API - 需要意见