This is a project template for Angular JS applications using Lineman.
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.js
- A router, and 2 views
home
andlogin
- A directive that shows a message on mouseover
- 2 Controllers, for
home
andlogin
, 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
- Docco CoffeeScript documentation generator
- Auto commit generated documentation to Github Pages.
- Restangular AngularJS module as opposed to $http or $resource
- Simple Express backend API consumed via Lineman's server proxy
- Livereload plugin
- Bower plugin
- Plugins
- Configuration
- AngularJS
- Run / Build
$ git clone git@github.com:jewelsjacobs/angularJS-linemanJS-meetup-demo.git my-lineman-app
$ cd my-lineman-app
$ sudo npm install -g lineman
$ sudo npm install -g bower
$ npm install
$ bower install
$ export NODE_ENV=development
$ node server/server.js
$ lineman run
- Your browser will open to localhost:8000
$ export NODE_ENV=production
$ node dist/server.js
$ lineman build
Note: This will deploy to heroku. If you don't want to deploy to heroku, follow the instructions on commenting and uncommenting lines 29-33 in the `/config/application.coffee file- Open your browser to http://localhost:8000
$ cd my-lineman-app
- Follow the instructions on commenting and uncommenting lines 29-33 in the `/config/application.coffee file
- Follow the instructions on Heroku for creating a heroku app in your app folder.
- Follow the instructions under the Git subtree command section here
to deploy the
dist
folder separately. $ lineman build
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 run
from 1 terminal windowlineman spec
from another terminal window, this will launch Testem and execute specs in Chrome
To run the end-to-end tests:
npm install protractor
brew install selenium-server-standalone
- Make sure you have chrome installed.
lineman run
from 1 terminal windowlineman grunt spec-e2e
from 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.js
to the actual you see in /usr/local/opt/selenium-server-standalone (brew users may have a libexec directory).
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).