Hello! I decided to immerse myself in the modern world of the front-end, tried to write an application and was a little depressed.

Suppose I based AngularJS. In index.html appeared

<script src="assets/libs/angular.min.js"></script> <script type="text/javascript" src="app/app.module.js"></script> 

It took only a couple of hours, and now I have two directives. Everyone is advised to put in a separate js file:

 <script type="text/javascript" src="app/shared/image-thumb-full/directive.js"></script> <script type="text/javascript" src="app/shared/shutter-image/directive.js"></script> 

Who are we without jQuery?

 <script src="http://code.jquery.com/jquery-1.12.0.min.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> 

Wanted a beautiful checkbox . Babakh - six more lines:

 <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script> 

Well, the font is also necessary normal, so that all the Material was

 <link href='https://fonts.googleapis.com/css?family=Roboto:700' rel='stylesheet' type='text/css'> 

And I also need a translation into several languages. And also some bootstrap. And it turns out some kind of porridge in index.html. Actually the question: is this the norm? Maybe there are some techniques, how to organize it better? Or is it really ok, everyone has it?

PS The project structure was taken from here . Unfortunately, they have no example of the project.

  • somehow you are not using the right angular language :) he doesn't need jQuery - Grundy
  • @Grundy oh, it was I who was looking for someone with such an opinion! Can I show you my task, and you say you could do without jQuery or not? - sinedsem
  • :-D ask a question :) this site is just for this :) - Grundy

1 answer 1

If you are concerned about the number of files you are connecting, then use Gulp . On the fly, you can collect all your libs, project files, minify them and merge them into one main file, which you will include in index.html

  • or primer or any other tool - Grundy