无法加载 ngRoute 模块

Unable to load ngRoute module

我正在开发一个使用 Angular 的 Node.js 项目,我正在尝试实现多个视图和路由。我已按照此处概述的说明安装 angular-route.js 文件和相关模块:

https://docs.angularjs.org/api/ngRoute

但我仍然在控制台中收到此错误:

Uncaught Error: [$injector:modulerr] Failed to instantiate module blogApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngRoute due to:
Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.20/$injector/nomod?p0=ngRoute

以下是与我的控制器和 HTML 文件相关的部分:

app.js

var blogApp = angular.module('blogApp', ['ngRoute']);

index.html

<!DOCTYPE html>
<html ng-app="blogApp">
  <head>
    <title>Blog Posts</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- styles -->
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="stylesheets/style.css" rel="stylesheet" media="screen">
  </head>
  <body ng-controller="postController">

   // page content

    <!-- scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular.js"></script>
    <script src"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular-route.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="javascripts/app.js"></script>
  </body>
</html>

我刚开始使用 Angular 和 Node,所以非常感谢任何对此的想法!

这只是一个错字(缺少等号)。这一行:

<script src"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular-route.js"></script>

应该是:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular-route.js"></script>

ngRoute 的脚本包含一个非常小的拼写错误。你有 src"https:// 而不是 src="https://

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular-route.js"></script>
<script src="http://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<script src="javascripts/app.js"></script>

您可以通过检查开发人员工具并确保脚本加载无误来调试此类问题。