Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/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
Angularjs正在使用express在节点应用程序上抛出未捕获错误:[$injector:modulerr]_Angularjs_Node.js_Express - Fatal编程技术网

Angularjs正在使用express在节点应用程序上抛出未捕获错误:[$injector:modulerr]

Angularjs正在使用express在节点应用程序上抛出未捕获错误:[$injector:modulerr],angularjs,node.js,express,Angularjs,Node.js,Express,我正在用express做一个节点应用程序。我现在正试图将angular集成到它中,但我的chrome控制台中出现了这两个错误 xgethttp://localhost:3000/javascripts/apx.js localhost/:13 x未捕获错误:[$injector:moduler]http://errors.angularjs.org/1.4.5/$injector/modulerr?p0=粗略&p1=错误%3A%2…ogleapis.com%2Fajax%2Flibs%2an

我正在用express做一个节点应用程序。我现在正试图将angular集成到它中,但我的chrome控制台中出现了这两个错误

xgethttp://localhost:3000/javascripts/apx.js   localhost/:13

x未捕获错误:[$injector:moduler]http://errors.angularjs.org/1.4.5/$injector/modulerr?p0=粗略&p1=错误%3A%2…ogleapis.com%2Fajax%2Flibs%2angularjs%2F1.4.5%2Fangular.min.js%3A19%3A381)angularjs:38

以下是my app.js提供静态文件的方式:

var app = express();
app.set('views', path.join(__dirname, 'views'));
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
目录结构:

simpleap>public>javascripts>apx.js

simpleapp>views>products>index.html

products/index.html:

<!DOCTYPE html>
<html ng-app="rough">
 <head>
    <title></title>
 </head>

 <body ng-controller="trx">
  {{title}}

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script src="/javascripts/apx.js"></script>
</body>
</html>

您能为您的问题创建plunker吗?你的javascript加载了吗?我没有plunker。我现在正在读有关它的书。我的js文件未加载。此问题已修复。我必须重新启动我的服务器。我之前做了更改,但没有重新启动服务器。您能为您的问题创建plunker吗?你的javascript加载了吗?我没有plunker。我现在正在读有关它的书。我的js文件未加载。此问题已修复。我必须重新启动我的服务器。我之前做了更改,并没有重新启动服务器。
var myapp = angular.module('rough', [])

myapp.controller('trx', function($scope){
  $scope.title = "wuewe"
});