【发布时间】:2014-10-21 12:37:53
【问题描述】:
我在尝试在自定义 Ektron 小部件中加载 AngularJS 模块时遇到问题。 app.js 文件开头为:
var app = angular.module('myApp', ['ngAnimate', 'ngRoute', 'kendo.directives', 'chieffancypants.loadingBar']);
我看到的错误是:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module kendo.directives due to:
Error: [$injector:nomod] Module 'kendo.directives' 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.
现在,我很确定我没有拼错它,并且 Kendo JavaScript 文件已加载,所以不确定发生了什么。就像最好的问题一样,它是间歇性的,它只在某些页面上发生,而且只是在某些时候发生,而且我在受影响的页面或它发生的时间中都看不到任何模式。
这是脚本文件:
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Includes/js/kendo/angular.js"></script>
<script type="text/javascript" src="/Includes/js/kendo/angular-animate.js"></script>
<script type="text/javascript" src="/Includes/js/kendo/angular-route.js"></script>
<script type="text/javascript" src="/Includes/js/kendo/kendo.all.min.js"></script>
<script type="text/javascript" src="/Includes/js/loading-bar.min.js"></script>
<script type="text/javascript" src="/Includes/js/app.js"></script>
干杯, 斯图尔特。
【问题讨论】:
标签: javascript angularjs kendo-ui ektron