简体   繁体   English

AngularJS依赖注入失败-拖放

[英]AngularJS Dependency injection failure - Drag&Drop

I'm trying to implement a Drag&Drop system. 我正在尝试实现拖放系统。 I've found an amazing one : http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested Github: https://github.com/marceljuenemann/angular-drag-and-drop-lists/issues 我发现了一个了不起的人: http ://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested Github: https : //github.com/marceljuenemann/angular-drag-and -下拉列表/问题

Now, it says load "dndLists" into my Dependency - So my app looks like this: 现在,它说将“ dndLists”加载到我的依赖项中-所以我的应用程序如下所示:

var app = angular.module('clarus_app', ['ngRoute'], ['dndLists'] );

but then it crashes. 但随后崩溃。

angular.js:116 Uncaught Error: [$injector:modulerr] Failed to instantiate module clarus_app due to: Error: [ng:areq] Argument 'fn' is not a function, got string angular.js:116未捕获的错误:[$ injector:modulerr]由于以下原因而无法实例化模块clarus_app:错误:[ng:areq]参数'fn'不是函数,得到了字符串

No idea what I'm doing wrong. 不知道我在做什么错。 The controller the page uses looks like this: app.controller("logCtrl", ['$scope','$location','$http', function($scope, $location, $http){ 页面使用的控制器如下所示: app.controller("logCtrl", ['$scope','$location','$http', function($scope, $location, $http){

Any help? 有什么帮助吗? any idea? 任何想法?

Thanks in advance. 提前致谢。

You have 2 different array arguments for module dependency and only want one array containing all dependencies 对于模块依赖性,您有2个不同的数组参数,只希望一个包含所有依赖性的数组

Change 更改

var app = angular.module('clarus_app', ['ngRoute'], ['dndLists'] );

To

var app = angular.module('clarus_app', ['ngRoute','dndLists'] );
                                      // ^^ single array of dependent module names

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM