0

在我的 app.js 中,我包含了 flow 的依赖项

var myApp = angular.module('myApp',['ui.router', 'ngResource', 'flow']);

我已将 javascript 包含在我的索引文件中以按如下方式加载

<script type="text/javascript" src="//cdn.jsdelivr.net/flow.js/2.0.0b2/flow.js"></script>

我收到错误模块“流”不可用!

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module flow due to:
Error: [$injector:nomod] Module 'flow' 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.23/$injector/nomod?p0=flow
4

2 回答 2

2

这可能是因为如果你想在 angularJs 中使用 ['flow'] 模块,你必须同时包含:flow.js 和 ng-flow。如果您使用的是 bower,并且它被配置为将库放在 js/vendor 上,则您必须执行类似的操作。

bower install "ng-flow#~2" --save


{{ HTML::script('js/vendor/flow.js/dist/flow.min.js') }}
{{ HTML::script('js/vendor/ng-flow/dist/ng-flow.min.js') }}

如果不是,只需寻找 ng-flow CDN。

此致!

于 2015-01-27T20:41:57.347 回答
0

您需要在您的 CDN 之前包含 http:

将您的脚本更改为此,它应该可以工作:

<script type="text/javascript" src="http://cdn.jsdelivr.net/flow.js/2.0.0b2/flow.js"></script>
于 2014-11-09T06:00:52.687 回答