Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the additional js files of the Angular.js framework for?

Tags:

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?

like image 936
Luciano Fiandesio Avatar asked Aug 17 '12 09:08

Luciano Fiandesio


People also ask

What is main js file in angular?

main. js : your application code and everything you have imported. vendor. js : third-party code that your application depends on.

In which folder are the most important files stored in AngularJS?

top-level “app” folder : all angular files should be placed within a folder that could be named as “app”. “app” is the top-level folder. app/components folder: one or more components can be placed within “app/components” folder.

What do you use AngularJS for?

AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write.


2 Answers

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.

like image 160
Artem Andreev Avatar answered Nov 03 '22 00:11

Artem Andreev


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

like image 36
afarazit Avatar answered Nov 03 '22 00:11

afarazit