This project (based on the angular-seed project) showcases an approach for awarding a set number of prizes across a provided event start and end date/time.
Clone the instant-win-timer repository and start hacking...
You can pick one of these options:
- serve this repository with your webserver
- install node.js and run
scripts/web-server.js
Then navigate your browser to http://localhost:<port>/app/index.html to see the app running in
your browser.
We recommend using jasmine and Karma for your unit tests/specs, but you are free to use whatever works for you.
Requires node.js, Karma (sudo npm install -g karma) and a local
or remote browser.
- start
scripts/test.sh(on windows:scripts\test.bat)- a browser will start and connect to the Karma server (Chrome is default browser, others can be captured by loading the same url as the one in Chrome or by changing the
config/karma.conf.jsfile)
- a browser will start and connect to the Karma server (Chrome is default browser, others can be captured by loading the same url as the one in Chrome or by changing the
- to run or re-run tests just change any of your source or test javascript files
Angular ships with a baked-in end-to-end test runner that understands angular, your app and allows you to write your tests with jasmine-like BDD syntax.
Requires a webserver, node.js + ./scripts/web-server.js or your backend server that hosts the angular static files.
Check out the end-to-end runner's documentation for more info.
- create your end-to-end tests in
test/e2e/scenarios.js - serve your project directory with your http/backend server or node.js +
scripts/web-server.js - to run do one of:
- open
http://localhost:port/test/e2e/runner.htmlin your browser - run the tests from console with Karma via
scripts/e2e-test.shorscript/e2e-test.bat
- open
app/ --> all of the files to be used in production
css/ --> css files
app.css --> default stylesheet
img/ --> image files
index.html --> app layout file (the main html template file of the app)
js/ --> javascript files
app.js --> application
directives.js --> application directives
lib/ --> angular and 3rd party javascript libraries
angular/
angular.js --> the latest angular js
angular.min.js --> the latest minified angular js
angular-*.js --> angular add-on modules
version.txt --> version number
partials/ --> angular view partials (partial html templates)
partial1.html
partial2.html
partial3.html
timer-form.html --> the templateUrl for the timerForm directive in app/js/directives.js
config/
karma.conf.js --> config file for running unit tests with Karma
karma-e2e.conf.js --> config file for running e2e tests with Karma
logs/ --> keep your logs here if you like
scripts/ --> handy shell/js/ruby scripts
e2e-test.sh --> runs end-to-end tests with Karma (*nix)
e2e-test.bat --> runs end-to-end tests with Karma (windows)
test.bat --> autotests unit tests with Karma (windows)
test.sh --> autotests unit tests with Karma (*nix)
web-server.js --> simple development webserver based on node.js
test/ --> test source files and libraries
e2e/ -->
runner.html --> end-to-end test runner (open in your browser to run)
scenarios.js --> end-to-end specs
lib/
angular/ --> angular testing libraries
angular-mocks.js --> mocks that replace certain angular services in tests
angular-scenario.js --> angular's scenario (end-to-end) test runner library
version.txt --> version file
unit/ --> unit level specs/tests
directivessSpec.js --> specs for directives
For more information on AngularJS please check out http://angularjs.org/