我有这个应用程序有两个模块:
angular.module('components', []).directive('foo', function () { return {};});
angular.module('gaad', ['components']);
Run Code Online (Sandbox Code Playgroud)
有一堆与这个模块相关的指令,我不在这里.该应用程序工作正常.但是当我试图检索模块的注入器时gaad:
var injector = angular.injector(['gaad', 'components']); //called after 'gaad' module initialization
Run Code Online (Sandbox Code Playgroud)
抛出错误:
Uncaught Error: Unknown provider: $compileProvider from components
Run Code Online (Sandbox Code Playgroud)
该应用程序现在很大,我不知道我应该在哪里寻找错误.所以我的问题是:我的问题可能是什么原因?
编辑: 我能够复制我的问题:http://jsfiddle.net/selbh/ehmnt/11/
我想这样做:
$("#canvasDiv").mouseover(function() {
var pageCoords = "( " + e.pageX + ", " + e.pageY + " )";
var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
$(".filler").text("( e.pageX, e.pageY ) : " + pageCoords);
$(".filler").text("( e.clientX, e.clientY ) : " + clientCoords);
});
Run Code Online (Sandbox Code Playgroud)
在控制台中我得到了这个:
Uncaught ReferenceError: e is not defined
我不明白......我认为e应该是JavaScript已经设置的变量...帮助?