Name: transmart-base-ui
Owner: TranSMART Project
Description: Boilerplate code for tranSMART UI
Created: 2015-01-23 15:49:33.0
Updated: 2016-07-08 11:35:52.0
Pushed: 2016-11-25 11:32:12.0
Homepage: null
Size: 827
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Boilerplate code for tranSMART UI
http://transmart-gb.thehyve.net
Make sure you have npm installed https://docs.npmjs.com/getting-started/installing-node
Run following from the project root
m install
wer install
lp serve
gulp
or gulp build
to build an optimized version of your application in /dist
gulp serve
to launch a browser sync server on your source filesgulp serve:dist
to launch a server on your optimized applicationgulp test
to launch your unit tests with Karmagulp test:auto
to launch your unit tests with Karma in watch modegulp protractor
to launch your e2e tests with Protractorgulp protractor:dist
to launch your e2e tests with Protractor on the dist filesMore information on the gulp tasks in this README.md.
There are different configurations available for development, testing and production: 'dev', 'test' and 'prod'. Specify your environment by passing a parameter to gulp ('dev' is the default):
Best Practice Recommendations for Angular App Structure
The root directory generated for a app with name gulpAngular
:
??? src/ ? ??? app/ ? ? ??? main/ ? ? ? ??? main.controller.js ? ? ? ??? main.controller.spec.js ? ? ? ??? main.html ? ? ??? index.js ? ? ??? index.(css|less|scss) ? ? ??? vendor.(css|less|scss) ? ??? assets/ ? ? ??? images/ ? ??? components/ ? ? ??? navbar/ ? ? ? ??? navbar.controller.js ? ? ? ??? navbar.html ? ??? 404.html ? ??? favico.ico ? ??? index.html ??? gulp/ ??? e2e/ ??? bower_components/ ??? nodes_modules/ ??? .bowerrc ??? .editorconfig ??? .gitignore ??? .jshintrc ??? bower.json ??? gulpfile.js ??? karma.conf.js ??? package.json ??? protractor.conf.js
Angular html5mode is enabled to remove hashtag in the typical AngularJS application. For that reason server side rewrites is needed. Following is Apache Rewrites:
tualHost *:80>
ServerName my-app
DocumentRoot /path/to/app
<Directory /path/to/app>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
</Directory>
rtualHost>
If you deploy it to another application server find the configuration here:
https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode