Closed sukazavr closed 6 years ago
@sukazavr I don't really know how Basset do asset ordering.
Since Basset doesn't really provides any method to handle dependencies, you shouldn't rely on alphabetic ordering to solve your Angular dependencies. I also use Angular and Basset and this is how I solve that:
$collection->javascript('app.js');
$collection->requireDirectory('app/templates');
$collection->requireDirectory('app/directives');
$collection->requireDirectory('app/services');
$collection->requireDirectory('app/filters');
$collection->requireDirectory('app/controllers');
I have a javascripts
folder with several subfolders for filters, controllers, templates, etc. In the root there's an app.js file which generates the Angular app:
// app.js
var app = angular.module('myApp', []);
Then each controller, service, filter just extends from that app
variable.
That way I don't have to worry which file is concatenated first, as long as my app.js is always on top of it.
Hope it helps.
In
app
folder:On
local
environment everything good, but onproduction
environment i get strangely sort, like this:Why
filters.js
is the first file?