This is a project template for Angular JS applications using Lineman and Lineman JS Template using Angular.
It includes the following features:
- Template Precompilation into Angulars $templateCache using
grunt-angular-templates - A basic login, logout service bound to sample routes inside
config/server.coffee - A router, and 2 views
homeandlogin - A directive that shows a message on mouseover
- 2 Controllers, for
homeandlogin, with $scope variables set and bound - A working, bound login form (username/password don't matter, but are required)
- Configured grunt-ngmin so you don't have to fully qualify angular dependencies.
- Auto generated sourcemaps with inlined sources via grunt-concat-sourcemap (you'll need to enable sourcemaps in Firefox/Chrome to see this)
- Unit Tests and End-to-End Tests
- Configuration to run Protractor for End-to-End Tests
git clone https://github.com/1uptalent/angular-app-boilerplate.git my-angular-appcd my-angular-appnpm install -g linemannpm install -g bowernpm installlineman run- open your web browser to localhost:3001
This template was used as the basis of @davemo's Testing Strategies for Angular JS screencast, and contains all the tests we wrote in the screencast and a few more!
To run the unit tests:
lineman runfrom 1 terminal windowlineman specfrom another terminal window, this will launch Testem and execute specs in Chrome
To run the end-to-end tests:
npm install protractorbrew install selenium-server-standalonebrew install chromedriver- Make sure you have chrome installed.
lineman runfrom 1 terminal windowlineman grunt spec-e2efrom another terminal window
Troubleshooting:
If you see this error: Warning: there's no selenium server jar at the specified location,
you may need to change the selenium-server-standalone jar version in config/spec-e2e.coffee
to the actual you see in /usr/local/opt/selenium-server-standalone/libexec.
If you see this error: Fatal error: The path to the driver executable must be set by the
webdriver.chrome.driver system property, you may need to download the chromedriver
(https://code.google.com/p/selenium/wiki/ChromeDriver) and place it in /usr/local/bin (mac).
Hopefully this helps you get up and running with AngularJS!