This project provides a baseline code base to help you kick start an Angular project that is based on BC Government themed Bootstrap styles, footers and headers.
This application has a complete development environment set up, including build, test, deploy, routing, simple components, service, and directives as examples and templates.
The goal is to help you start a project fast, enable you to focus on building actual business logics for your project.
Check out a running demo of just scaffold out of the box
Node 6.9.x or greater must be installed (an angular-cli requirement).
Note, use angular/cli
, do not use angular/angular-cli
npm i -g @angular/cli
ng
is the CLI itself
Verify the installation
npm list -g @angular/cli --depth=0
ng -v
npm i -g yarn
yarn install
npm start
to start the a webpack server to run the application on port 4300
Go to http://localhost:4300 to verify that the application is running
To change the default port, open .angular-cli.json
, change the value on default.serve.port
npm run build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build, like so: ng serve --prod
to run in production mode.npm run lint
to check stylesRun ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|module
.
ng g c customer -d
ng g d search-box -d
ng g s general-data -d
Angular will give out a warning line after this command,
WARNING Service is generated but not provided, it must be provided to be used
After generating a service, we must go to its owning module and add the service to the providers
array.
ng g s general-data2 -m app.module
ng g cl models/customer
ng g i models/person
ng g enum models/gender
ng g pipe shared/init-caps
Create a login directory and generate a login module in that directory
ng g module login/login.module
Generate a module called admin and add routing feature to it.
ng g module admin --routing
For guidance on how to make your app accessible, see our /ACCESSIBILITY.md
docs for more info.
Set up via Karma, Jasmine
ng test
by default to watch file changesSet up with Protractor
Run ng e2e
to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via ng serve
.
ng help
or go check out the Angular CLI README.ng doc component
to look up documentation for featuresng serve --help
to look up doc for ng serve
commandng set default.styleExt css
ng new my-app --routing --style scss
For dev, test, and production builds on OpenShift/Jenkins see openshift/README.md
for detailed instructions
on how to setup in an OpenShift environment using nginx.
The NGINX configuration has an endpoint that can be set to pass-through to a back-end service for configuration data to be served by the same service as the Angular SPA.