Answer the question
In order to leave comments, you need to log in
Building a project under Angular. How does anyone do it?
Recently, I have been writing a lot in AngularJS. Medium projects (2-4K lines). There was a question about the assembly of the project.
GruntJS is used for assembly, at the moment I use the following approach for myself (borrowed from the grunt file of Angular itself:
every directive, controller, service, etc. in a separate file. Everything is divided into catalogs (by modules and by purpose). There is a file AppFiles.json which contains the list of all files divided into separate modules. Next, modules are assembled, concatenation is performed, and these modules are already used in the index. The advantages of this approach are obvious: everything is easy to find, any filter, service or directive of interest ... The disadvantages are also obvious - when changing one single file, you have to rebuild the entire project. The task has so far been solved through watchers, but I don't like it. On average, there are about 50-100 files in projects, so connecting each one separately is also not an option. I thought of writing a mini-plugin that will collect modules like this:
<!-- module:app dist:dist/someModule.js -->
<script src="src/someModule/someModule.js"></script>
<script src="src/someModule/services/TestService.js"></script>
...
<!-- endmodule-->
Answer the question
In order to leave comments, you need to log in
I use yeoman (it sets up Grunt). You can also look at ng-boilerplate
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question