【发布时间】:2017-02-13 12:39:31
【问题描述】:
我正在使用node.js 从server.js 文件中的目录('.public/jsonfiles')获取文件。但是我无法使用AngularJS 和Node.js 服务将这些文件列表显示在我的视图页面上。
错误:
我收到 data.forEach 不是函数错误(我可以在控制台中看到全部 html 内容,而不是在返回语句中的服务文件中看到我的文件列表:return $http.get('/public/jsonfiles');
否则,如果我给出:return $http.get('').then(function(data){ console.log(data)}); /giving Main.get() 成功不是一个函数,总共给出html content on console
创建repository。
【问题讨论】:
标签: javascript angularjs json node.js express