This is where the majority of development work will occur. It contains all of the application code, tests, and assets.
src/
|- app/
|- assets/
|- index.html
src/app/
- contains all of the application code and corresponding testssrc/assets/
- static files like fonts and imagessrc/index.html
- this is the HTML document of the single-page application
The index file is the HTML document of the single-page application (SPA). This is the highest level container for everything in your angular application.
The application module (orderCloud) and application controller (AppCtrl)
are both loaded on the <html>
element. We use the
controllerAs syntax, so keep
in mind that anything attached to the AppCtrl
view model is accessible under the name
application
in all of your template files.
Within the <head>
element there are some basic <meta>
tags and a dynamic
<title>
tag which takes advantage of ui-router
's $state
service and the appname
constant. You can see how we are referencing the AppCtrl
via the controllerAs syntax below:
//dynamic application title
<title ng-bind="application.$state.current.data.pageTitle + (application.$state.current.data.pageTitle ? ' | ' : '') + application.name()">
OrderCloud
</title>
After the <title>
, there are some very important comments that are
used to dynamically set the base[href]
attribute and inject reference bower and application
CSS styles during the gulp build
and compile
.
At the end of the <head>
you will find the link for the OrderCloud favicon.
The body element contains the ui-view
in which all other application templates will be loaded.
Within the <ui-view>
element we've placed the HTML used by cg-busy to display a
loading indicator while angular bootstraps itself.
At the end of the body we again have some important comment markup that is used to dynamically inject all of the bower and application javascript files.