2016-04-10 4 views
0

Ich bin ziemlich neu in Angular und Meteor. Ich versuche ein Projekt mit Angular-Meteor zu erstellen.Wie wird angular-acl in einem Winkelmeteor-Projekt verwendet?

Ein Teil meiner Angular app.js ist wie folgt.

import AclService from 'angular-acl'; 
angular.module('myApp', [angularMeteor, uiRouter,AclService, 'accounts.ui']); 

Ich versuche, das Angular-ACL Plugin zu verwenden.

Wenn ich die App ausführen, erhalte ich den folgenden Fehler in der Browserkonsole.

VM4605 modules.js?hash=afc491d…:232 Uncaught Error: [$injector:modulerr] 

Failed to instantiate module myApp due to: 
Error: [$injector:modulerr] Failed to instantiate module {} due to: 
Error: [ng:areq] Argument 'module' is not a function, got Object 
http://errors.angularjs.org/1.5.3/ng/areq?p0=module&p1=not%20a%20function%2C%20got%20Object 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:232:12 
    at assertArg (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:2008:11) 
    at assertArgFn (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:2018:3) 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4697:11 
    at forEach (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:485:20) 
    at loadModules (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4672:5) 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4689:40 
    at forEach (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:485:20) 
    at loadModules (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4672:5) 
    at createInjector (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4594:19) 
http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=%7B%7D&p1=Error%3A%…2Fmodules.js%3Fhash%3Dafc491df237c732f4ec721460c9455fc18cc0d9d%3A4594%3A19) 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:232:12 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4711:15 
    at forEach (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:485:20) 
    at loadModules (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4672:5) 
    at http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4689:40 
    at forEach (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:485:20) 
    at loadModules (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4672:5) 
    at createInjector (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:4594:19) 
    at doBootstrap (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:1874:20) 
    at bootstrap (http://localhost:3000/packages/modules.js?hash=afc491df237c732f4ec721460c9455fc18cc0d9d:1895:12) 
http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=myApp&p1=Er…2Fmodules.js%3Fhash%3Dafc491df237c732f4ec721460c9455fc18cc0d9d%3A1895%3A12)(anonymous function) @ VM4605 modules.js?hash=afc491d…:232(anonymous function) @ VM4605 modules.js?hash=afc491d…:4711forEach @ VM4605 modules.js?hash=afc491d…:485loadModules @ VM4605 modules.js?hash=afc491d…:4672createInjector @ VM4605 modules.js?hash=afc491d…:4594doBootstrap @ VM4605 modules.js?hash=afc491d…:1874bootstrap @ VM4605 modules.js?hash=afc491d…:1895angularInit @ VM4605 modules.js?hash=afc491d…:1780(anonymous function) @ VM4605 modules.js?hash=afc491d…:30873fire @ VM4606 jquery.js?hash=649d9f4…:3185self.fireWith @ VM4606 jquery.js?hash=649d9f4…:3297jQuery.extend.ready @ VM4606 jquery.js?hash=649d9f4…:3509completed @ VM4606 jquery.js?hash=649d9f4…:3540 

Irgendwelche Ideen, was schief gehen könnte?

Antwort

0

OK Ich schwöre, ich habe seit gestern eine Antwort darauf gesucht. Aber es scheint so, als hätte ich vor der Veröffentlichung dieser Frage nicht genug Google geschaltet. Tut mir wirklich leid.

Auf jeden Fall fand ich die Antwort myself.The erforderlich Spitze aus dem Artikel kam [angularJS]How to use angular-acl?

ich meinen Code wie folgt verändert und alles funktioniert jetzt gut.

angular.module('myApp', [angularMeteor, uiRouter,'mm.acl', 'accounts.ui']); 

Der Grund dafür, dass (glaube ich) die Plugin Angular-ACL in dem Winkel acl.js definiert wird, ist wie folgt.

Hoffen, das hilft jedem anderen, der ein ähnliches Problem hat. Prost!

Verwandte Themen