This application is an example of a web-application that speaks to and renders Norch using angular.js. The application is loosely based on the Google Phone Gallery, which no longer exists, the Angular Phone Tutorial, and the Angular-Seed Project
You need to set up a remote norch in order for this app to work- see 'Norch' section below.
npm install
).Because a norch
dependency - search-index
has some breaking changes, you need to use an older version. Do this by installing like this:
sudo npm install -g norch@0.6.16
world-bank-projects-norchified.json
. You can do this by using the GUI in norch and navigating to the file on your PC, or by running curl --form document=@world-bank-projects-norchified.json http://localhost:3030/indexer --form filterOn=mjtheme,totalamt
from the command line, or by investigating Norch-Indexer./node_modules/norch/bin/norch -c http://localhost:8000
The following docs describe how you can test and develop further this application.
The easiest way is to just get the code with git clone
:
git clone git@github.com:fergiemcdowall/norch-angular-app.git
The application relies upon various node.js tools, such as Bower, Karma and Protractor. You can install these by doing:
cd ./norch-angular-app
npm install
This will also run bower, which will download the angular files needed for the current step of the tutorial.
Most of the scripts described below will run this automatically but it doesn't do any harm to run it whenever you like.
npm start
http://localhost:8000/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.
npm test
test/karma.conf.js
file.We recommend using Jasmine and Protractor for end-to-end testing.
Requires a webserver that serves the application. See Running the app during development, above.
npm start
.npm run protractor
. Protractor will execute the
end2end test scripts against the web application itself.
npm run update-webdriver
, and modify the
configuration at test/protractor-conf.js
.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 --> the main application module
controllers.js --> application controllers
directives.js --> application directives
filters.js --> custom angular filters
services.js --> custom angular services
animations.js --> hooks for running JQuery animations with ngAnimate
partials/ --> angular view partials (partial html templates) used by ngRoute
partial1.html
partial2.html
bower_components --> 3rd party js libraries, including angular and jquery
scripts/ --> handy scripts
update-repo.sh --> pull down the latest version of this repos
(BE CAREFUL THIS DELETES ALL CHANGES YOU HAVE MADE)
private/ --> private scripts used by the Angular Team to maintain this repo
test/ --> test source files and libraries
karma.conf.js --> config file for running unit tests with Karma
protractor-conf.js --> config file for running e2e tests with Protractor
e2e/
scenarios.js --> end-to-end specs
unit/ --> unit level specs/tests
controllersSpec.js --> specs for controllers
directivesSpec.js --> specs for directives
filtersSpec.js --> specs for filters
servicesSpec.js --> specs for services