我是一个node.js新手,经过一个简单的教程后,我试图加载一个使用node.js的开源应用程序,我收到下面的错误。我确定这是一个微不足道的配置问题,但我没有看到它。
ReferenceError: angular is not defined
at Object.<anonymous> (d:\projects\nodeapp\app\app.js:7:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
这是发生错误的app.js。
/**
* App bootstrap script <----- START OF FILE
*/
'use strict';
var nodeapp = angular.module('nodeapp', ['ngRoute', 'ngSanitize', 'ngAnimate']); <----- ERROR
这是index.html
<!doctype html>
<html ng-controller="AppCtrl">
<head>
<meta charset="utf-8">
<title>App</title>
<link href="./visual/css/main.css" rel="stylesheet" type="text/css">
<script src="./bower_components/jquery/jquery.min.js"></script>
<script src="./bower_components/angular/angular.js"></script>
<script src="./bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="./bower_components/angular-route/angular-route.js"></script>
<script src="./bower_components/angular-animate/angular-animate.js"></script>
... more scripts ...
<script src="./app.js"></script>
</head>
<body class='app-not-ready'>
<ng-view></ng-view>
<div class="notification-bar"
ng-if="notificationBarVisible"
ng-animate
ng-bind="notificationMessage"></div>
</body>
</html>
这是文件夹结构
答案 0 :(得分:3)
node i
中的项目根目录中运行)。开始node app.js
并打开http://localhost:3000
。