Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Yeoman-Javascript加载错误_Node.js_Angularjs_Express_Yeoman - Fatal编程技术网

Node.js Yeoman-Javascript加载错误

Node.js Yeoman-Javascript加载错误,node.js,angularjs,express,yeoman,Node.js,Angularjs,Express,Yeoman,这是我的应用程序结构 Yeoman配备angular和coffee服务器(node+express),通过/app/获取视图和公共文件 查看文件: app.set("view_engine", "html").engine "html", (path, options, fn) -> if "function" is typeof options fn = options options = {} fs.readFile path, "utf8", fn 公共文件

这是我的应用程序结构

Yeoman配备angular和coffee服务器(node+express),通过/app/获取视图和公共文件

查看文件:

app.set("view_engine", "html").engine "html", (path, options, fn) ->
  if "function" is typeof options
    fn = options
    options = {}
  fs.readFile path, "utf8", fn
公共文件:

app.use express.static(path.resolve(__dirname + "/app/"))
我确实加载了很多组件,比如引导、主题文件等。但是,视图文件中的Javascript不起作用。它确实正常工作

例如,如果我删除并替换为For morris charts,它将起作用。ng应用程序也是如此,而具有的视图文件不会加载图表

我认为问题在于首先加载js文件,因为当我尝试登录时,javascript文件在视图的控制器之前发送消息。因此,我猜js文件在视图之前加载,从而使javascript文件无法访问id

请告诉我怎么解决这个问题。这已经困扰我两天多了

提前谢谢

可能在这里回答:


您是否在angularJS之前包含jQuery?如果没有,angularJS正在使用jqLite,它无法处理这样的情况。

是的。角度资源排在最后。同样的约曼结构(yo angular command)。当html元素在索引文件中时,它工作,但当html元素在视图文件中时,它不工作。