https://github.com/arulkumar-lab/arul-ui-angularjs
AngularJS sample application with testcase run
https://github.com/arulkumar-lab/arul-ui-angularjs
Last synced: 3 months ago
JSON representation
AngularJS sample application with testcase run
- Host: GitHub
- URL: https://github.com/arulkumar-lab/arul-ui-angularjs
- Owner: arulkumar-lab
- License: mit
- Created: 2019-11-04T10:46:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T17:28:59.000Z (over 3 years ago)
- Last Synced: 2025-01-31T23:44:35.985Z (over 1 year ago)
- Language: HTML
- Homepage:
- Size: 733 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `arul-ui-angularjs` — the sample application for AngularJS apps loads from template
This project is an application skeleton for a typical [AngularJS][angularjs] web app. You can use it
to quickly bootstrap your angular webapp projects and dev environment for these projects.
The `depth=1` tells git to only pull down one commit worth of historical data.
### Install Dependencies
We have two kinds of dependencies in this project: tools and AngularJS framework code. The tools
help us manage and test the application.
* We get the tools we depend upon and the AngularJS code via `npm`, the [Node package manager][npm].
* In order to run the end-to-end tests, you will also need to have the
[Java Development Kit (JDK)][jdk] installed on your machine. Check out the section on
[end-to-end testing](#e2e-testing) for more info.
We have preconfigured `npm` to automatically copy the downloaded AngularJS files to `app/lib` so we
can simply do:
```
npm install
```
Behind the scenes this will also call `npm run copy-libs`, which copies the AngularJS files and
other front end dependencies. After that, you should find out that you have two new directories in
your project.
* `node_modules` - contains the npm packages for the tools we need
* `app/lib` - contains the AngularJS framework files and other front end dependencies
*Note copying the AngularJS files from `node_modules` to `app/lib` makes it easier to serve the
files by a web server.*
### Run the Application
We have preconfigured the project with a simple development web server. The simplest way to start
this server is:
```
npm start
```
Now browse to the app at [`localhost:8000/index.html`][local-app-url].
## Directory Layout
```
app/ --> all of the source files for the application
app.css --> default stylesheet
core/ --> all app specific modules
version/ --> version related components
version.js --> version module declaration and basic "version" value service
version_test.js --> "version" value service tests
version-directive.js --> custom directive that returns the current app version
version-directive_test.js --> version directive tests
interpolate-filter.js --> custom interpolation filter
interpolate-filter_test.js --> interpolate filter tests
view1/ --> the view1 view template and logic
view1.html --> the partial template
view1.js --> the controller logic
view1_test.js --> tests of the controller
view2/ --> the view2 view template and logic
view2.html --> the partial template
view2.js --> the controller logic
view2_test.js --> tests of the controller
app.js --> main application module
index.html --> app layout file (the main html template file of the app)
index-async.html --> just like index.html, but loads js files asynchronously
e2e-tests/ --> end-to-end tests
protractor-conf.js --> Protractor config file
scenarios.js --> end-to-end scenarios to be run by Protractor
karma.conf.js --> config file for running unit tests with Karma
package.json --> Node.js specific metadata, including development tools dependencies
package-lock.json --> Npm specific metadata, including versions of installed development tools dependencies
```
## Testing
```
npm test
```
```
npm run test-single-run
```
### Running End-to-End Tests
```
npm start
```
```
npm run update-webdriver
```
Once you have ensured that the development web server hosting our application is up and running, you
can run the end-to-end tests using the supplied npm script:
```
npm run protractor
```
This script will execute the end-to-end tests against the application being hosted on the
development server.
## Updating AngularJS and other dependencies
Since the AngularJS framework library code and tools are acquired through package managers (e.g.
npm) you can use these tools to easily update the dependencies. Simply run the preconfigured script:
```
npm run update-deps
```
This will call `npm update` and `npm run copy-libs`, which in turn will find and install the latest
versions that match the version ranges specified in the `package.json` file.
If you want to update a dependency to a version newer than what the specificed range would permit,
you can change the version range in `package.json` and then run `npm run update-deps` as usual.
## Loading AngularJS Asynchronously
```
npm run update-index-async
```
### Running the App during Development
You can start this web server with `npm start`, but you may
choose to install the tool globally:
```
sudo npm install -g http-server
```
Then you can start your own development web server to serve static files from any folder by running:
```
http-server -a localhost -p 8000
```
## Contact
For more information on AngularJS please check out [angularjs.org][angularjs].
[angularjs]: https://angularjs.org/
[git]: https://git-scm.com/
[http-server]: https://github.com/indexzero/http-server
[jasmine]: https://jasmine.github.io/
[jdk]: https://wikipedia.org/wiki/Java_Development_Kit
[jdk-download]: http://www.oracle.com/technetwork/java/javase/downloads
[karma]: https://karma-runner.github.io/
[local-app-url]: http://localhost:8000/index.html
[node]: https://nodejs.org/
[npm]: https://www.npmjs.org/
[protractor]: http://www.protractortest.org/
[selenium]: http://docs.seleniumhq.org/
[travis]: https://travis-ci.org/
[travis-docs]: https://docs.travis-ci.com/user/getting-started