Building and Testing
In addition to the described folders we can notice several top level files. Just for
reference those files are:
- .gitignore: The git SCM related includes rules to indicate which files
should not be tracked in a git repository - LICENSE: It contains terms of the MIT license
- Gruntfile.js: It is the entry point to the grunt.js build
- package.json: It contains the package description for the
node.js applications
Inside the source folder
With the basics addressed we are now ready to dive into the structure of the src
folder. Let's have a look at its visualization first:
The index.html file is the entry point to the sample application. Then, there are
four folders, two of them holding AngularJS-specific code (app and common) and
two others contain AngularJS-agnostic presentation artifacts (assets and less).
It is easy to decipher the purpose of the assets and the less folders; the first one
holds images and icons while the second one, LESS variables. Please note that the
LESS templates for Twitter's Bootstrap CSS are located in the vendor folder, here
we just keep variable values.
AngularJS specific files
AngularJS applications consist of two different file types, namely, scripts and HTML
templates. Any non-trivial project will produce many files of each type and we need
to find a way to organize this mass of files. Ideally we would like to group related
files together and keep the unrelated ones further apart. The trouble is that files can
relate to each other in many different ways and we've got only one directory tree to
express those relations.