-
Notifications
You must be signed in to change notification settings - Fork 134
wrong controller instantiation with multiple modules #173
Comments
Just checked this out. Same for me here. But i'm not so sure about the point, that this worked in earlier versions. angular.module('myProject', [
// your modules
'test',
'main'
]); Seems like last one 'wins'. Apart from this problem, I would prefer a naming of the start controller, service etc in the module name. |
I'll look into it. Thanks for verifying 👍 |
Found this: http://stackoverflow.com/questions/13406791/modules-and-name-clashes-in-angularjs/19820088#19820088 |
@MathiasTim I think naming the start controller, services templates and config constant based on the module name is a good idea. Unfortunately this is quite a bit of work and it also affects how the config constant and its gulp tasks should work. Let's discuss this. |
related to: #148 @gruppjo @DrMabuse23 I think we should set up a meeting via Skype, or maybe at M-Way to discuss this. Im not really convinced by our current strategy/use of modules in angular. |
Result of discussion:
|
I may be being stupid here, but does this address the issue that each module is created via the Which I had to manually rename as my abstract view controller with its default StartCtrl name didnt work as it was clashing with the other module (main)'s controller named StartCtrl |
Hi @LunarDevelopment. That exactly is the problem. |
yo m --skip-prompts
gulp watch
StartCtrl and Service from module main are properly instantiated
yo m:module test
gulp watch
http://127.0.0.1:9000/#/main
StartCtrl and Service from module test instead of main are falsely instantiated
This seems to be a general problem with angular since the problem occurred without using ui-router as well and even without controllerAs syntax. However I'm fairly sure this worked correctly in earlier versions.
index.html:
main.js
The text was updated successfully, but these errors were encountered: