I have encountered an Angular error due to the sorting of my files, so I am attempting to organize them properly.
This is the content of my Gulp file:
var gulp = require('gulp');
var angularFilesort = require('gulp-angular-filesort');
var naturalSort = require('gulp-natural-sort');
var inject = require('gulp-inject');
gulp.task('index', function () {
var target = gulp.src('./public/index.html');
var sources = gulp.src(
['./**/*.js', './**/*.css'],
{
read: false,
cwd: __dirname + "/public/",
}
).pipe(angularFilesort());
return target.pipe(inject(sources, { addRootSlash: false }))
.pipe(gulp.dest('./public'));
});
The current order in which the files are sorted is as follows:
<!-- inject:js -->
<script src="app.js"></script>
<script src="controllers/add.js"></script>
<script src="controllers/main.js"></script>
<script src="filters/fromNow.js"></script>
<script src="services/show.js"></script>
<script src="vendor/angular-cookies.js"></script>
<script src="vendor/angular-messages.js"></script>
<script src="vendor/angular-resource.js"></script>
<script src="vendor/angular-route.js"></script>
<script src="vendor/angular-strap.js"></script>
<script src="vendor/angular-strap.tpl.js"></script>
<script src="vendor/angular.min.js"></script>
<script src="vendor/moment.min.js"></script>
<!-- endinject -->
Additionally, here are the folders for reference:
https://i.sstatic.net/vThl1.png
and the displayed console errors:
https://i.sstatic.net/aKBvk.png
Could you please advise on what might be missing or causing this issue?