【问题标题】:AngularJS Full-Stack generator not saving js or controller to index.htmlAngularJS 全栈生成器未将 js 或控制器保存到 index.html
【发布时间】:2014-10-23 04:57:07
【问题描述】:

我很欣赏 Yeoman 的开发方法,最近开始使用 generator-angular-fullstack。

我尝试创建路线,使用:

yo angular-fullstack:route myroute

文档说它将连接生成器所做的所有样板,但是奇怪的是,它没有将新路由的 javascript 或控制器包含到 index.html 文件中的标记中,我不得不手动包括这个标签。

生成器的目的不是减少重复的样板吗?简单的 jane Yeoman Angular 生成器就是这样做的。

我在这里遗漏了什么?是否有 --save 类型标志?否则非常棒的工具!

【问题讨论】:

    标签: javascript angularjs generator


    【解决方案1】:

    你应该最终得到 - 我想我在 v2.0.13

    <script src="app/work/myroute.controller.js"></script>
    <script src="app/work/myroute.js"></script>
    

    就在 main.js 下面。如果不是,您可能有权限问题?

    还要确保你是最新的,他们移动得很快。

    npm update -g yo   
    npm update -g generator-angular-fullstack
    

    另外,我会尝试生成一个新项目,看看它的工作方式是否有所不同,因为最近整个目录结构发生了变化。

    【讨论】:

    • 我使用的是 v2.0.13,版本要求比预期的要高。不知道怎么办:$ npm list -g generator-angular-fullstack npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/normalize-package-data requires github-url-from-git@'~1.1.1' but will load /usr/local/lib/node_modules/npm/node_modules/github-url-from-git, which is version 1.4.0 /usr/local/lib/node_modules/npm/node_modules/normalize-package-data requires github-url-from-username-repo@'^0.2.0' but will load /usr/local/lib/node_modules/npm/node_modules/github-url-from-username-repo,which is version 1.0.0
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-28
    • 2016-09-06
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多