Open oviava opened 9 years ago
Do you get any module loading error from Angular? What did you expect the sort order to be?
Your main app module is dependent on janus.common
, etc, so it's logical that it's added after those modules.
i think he has the same problem than me.
security depends on common, but common gets imported first.
I have a hard time trying to recreate your issue.
I've created a simple app with the following structure:
├── app.js # declares app, depends on mod1, mod2, mod3
├── index.html
├── mod1
│ ├── mod1-ctrl.js # depends on mod1
│ └── mod1.js # declares mod1, depends on mod2
├── mod2
│ ├── mod2-ctrl.js # depends on mod2
│ ├── mod2-service.js # depends on mod2
│ └── mod2.js # declares mod2, depends on nothing
└── mod3
├── mod3-ctrl.js # depends on mod3
└── mod3.js # declares mod3, depends on mod2
When running gulp-angular-filesort
i get the following sortorder which is put in index.html
:
<script src="mod3/mod3.js"></script>
<script src="mod3/mod3-ctrl.js"></script>
<script src="mod2/mod2.js"></script>
<script src="mod2/mod2-ctrl.js"></script>
<script src="mod2/mod2-service.js"></script>
<script src="mod1/mod1.js"></script>
<script src="mod1/mod1-ctrl.js"></script>
<script src="app.js"></script>
When opening index.html
I get no errors and the app works as expected. It does not matter that mod3
is sorted before mod2
, angular does not care about that, the important part is that each module is sorted before their respective controllers, services, etc.
You can download the sample files here yourself: https://drive.google.com/file/d/0Bw3qo-O7AmgId3gySmhNUHlJV2s/view?usp=sharing
Is there anything I'm missing?
Directory structure:
Main app code:
Gulp:
My main app is added after janus.security & janus.common .. I've read the previous issues in here but can't seem to get this fixed.