1

With AngularJS it is easy to split up the application and also include external modules that we want to use. But with the way we do it today the index.html can be littered with the different external references and it's hard to see which is really needed by the modules.

Is there a good way to handle how external dependencies of the modules (such as html templates, css and js files) are "included"?

Ideally we would like to just add one reference in index.html along with the reference to the external used angular module and this in turn includes the needed dependencies. Is that possible?

1 Answer 1

1

As Angular doesn't have a dependency loader, you have two options:

  1. Use a third-party loader like RequireJS that fetches the files asynchronously one by one.
  2. Use a build-tool like browserify or Grunt to wrap everything into one javascript file that you can then include.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.