Javascript &引用;未能实例化模块ngSanitize";使用PhantomJS预渲染AngualrJS站点时

Javascript &引用;未能实例化模块ngSanitize";使用PhantomJS预渲染AngualrJS站点时,javascript,angularjs,phantomjs,Javascript,Angularjs,Phantomjs,我正在尝试使用PhantomJS预渲染我的AngularJS站点。(使用phantomjs-runner.js from)由于出现以下错误,我无法通过phantomjs加载页面。IE/Chrome/Firefox中不会出现此错误 如何着手修复此错误 错误: Error: [$injector:modulerr] Failed to instantiate module SpaceForAfrica due to: Error: [$injector:modulerr] Failed to ins

我正在尝试使用PhantomJS预渲染我的AngularJS站点。(使用phantomjs-runner.js from)由于出现以下错误,我无法通过phantomjs加载页面。IE/Chrome/Firefox中不会出现此错误

如何着手修复此错误

错误:

Error: [$injector:modulerr] Failed to instantiate module SpaceForAfrica due to:
Error: [$injector:modulerr] Failed to instantiate module dialogs due to:
Error: [$injector:modulerr] Failed to instantiate module ngSanitize due to:
Error: [$injector:nomod] Module 'ngSanitize' 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.2.1/$injector/nomod?p0=ngSanitize
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js:1507
    at ensure (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js:1435)
    at module (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js:1717)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.js:3527
模块配置

var SpaceForAfrica = angular.module('SpaceForAfrica', ['ngRoute', 'HashBangURLs', 'ui.bootstrap', 'ui.bootstrap.tpls', 'google-maps', 'ui.growl', 'dialogs', 'ngSanitize', 'angularSpinner','angulartics', 'angulartics.google.analytics']).config(spaceForAfricaConfig);

看起来您可能缺少对ngSanitize代码的引用。ngSanitize是AngularJS框架()的一部分,但是,为了利用它,必须在PhantomJS引用之前包含一个单独的引用

看起来您使用的是AngularJS的1.2.1版,因此您可以轻松地添加其中一个标记(或者抓取代码以包含在您自己的应用程序中)

非小型化:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular-sanitize.js"></script>

缩小:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular-sanitize.min.js"></script>