繁体   English   中英

angularjs生成器中的Coffeescript在控制台中找不到js文件

[英]Coffeescript in angularjs generator cannot find js file in console

我测试了generator-angular并制作了这样的测试应用程序

yo angular

然后我已经阅读了文档,可以使用coffeescript而不是js文件,因此我在coffeescript中创建了一个名为user的控制器,如下所示

yo angular:contrller user --coffee

我将app.js文件中的控制器更改为UserCtrl然后使用

grunt serve

当我检查控制台时,因为它不起作用,它说

Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1:9000/scripts/controllers/user.js

我执行了相同的命令,并且运行正常。 当您运行

yo angular:控制用户--coffee

它应该创建两个文件

  create app/scripts/controllers/user.js
  create test/spec/controllers/user.js

同样,在不更改app.js的情况下,请先检查是否可以运行

咕server服务器

我建议重新运行

哟角

命令并确保所有文件均已正确安装,因为根据您的选择安装所有依赖项至少需要花费几分钟。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM