22

I'm trying out angular.js and I'm confused by the number of javascript files that I should import. In the 1.0.1 release there are a bunch of additional files such as:

  • angular-bootstrap-1.0.1.js
  • angular-loader-1.0.1.js
  • angular-resource-1.0.1.js
  • angular-sanitize-1.0.1.js

Naturally I have opened these files to try to understand what is their function. For instance, angular-loader has a comment that says:

Interface for configuring angular {@link angular.module modules}.

To me, it sounds like an important module, but my simple app works ok without it...

Shall I import all of them?

4
  • If you just try to open those files with any text editor you'll see what they do in the comment right at the top.
    – Adi
    Aug 17, 2012 at 9:23
  • 1
    angular-bootstrap has no comments whatsoever. The other files have very lenghty comments, but it's not clear to me if they should be included in a default angular web app. For instance: A factory which creates a resource object that lets you interact with * RESTful server-side data sources. Aug 17, 2012 at 9:29
  • Of course I have opened the files myself, but it is not clear to me if these files are mandatory or not. The simple app works fine without them. Aug 17, 2012 at 9:33
  • 3
    These files are modules (or plugins) that may - but may as well not - be used along with angular.js to somewhat widen its functionality. They're not required; including just angular.js (or angular.min.js) would be enough.
    – raina77ow
    Aug 17, 2012 at 12:11

2 Answers 2

23

Disclaimer: it is my thoughts. I am not core developer.

AngularJS has base ng module (angular-1.0.1.js) which all basically use and some add-on modules. If you look at the api documentation you will see that the table of contents on the left side is divided into blocks: ng module, ngMock module, ngCookies module, etc.

angular-bootstrap-1.0.1.js seems as bootstrap-like implementations of dropdown and tabs. I think they are mainly used on angularjs.org. But can be used by anyone (thanks to the MIT license).

angular-cookies-1.0.1.js is ngCookies module which provide two services: $cookies and $cookieStore.

angular-loader-1.0.1.js as far as I understand should help to setup angular (ensure that all required modules loaded, etc) in external environments.

angular-resource-1.0.1.js is ngResource module which provide $resource service.

angular-sanitize-1.0.1.js is ngSanitize module which provide ngBindHtml directive, linky filter and $sanitize service.

9

Here be the official answer to your question http://docs.angularjs.org/misc/downloading

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.