Giter VIP home page Giter VIP logo

belloyang / angular-scaffold Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcgov/angular-scaffold

0.0 0.0 0.0 1.17 MB

๐Ÿš€ Kick start an Angular 4 project that is based on BC Government themed Bootstrap styles, footers and headers.

Home Page: https://angular-scaffold-demo.pathfinder.gov.bc.ca/

License: Other

TypeScript 36.71% JavaScript 5.81% HTML 6.73% Shell 48.55% Dockerfile 1.61% SCSS 0.59%

angular-scaffold's Introduction

Known Vulnerabilities

๐Ÿš€ angular-scaffold

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

Development Prerequisites

Node and NPM

Node 6.9.x or greater must be installed (an angular-cli requirement).

Install angular/cli

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

Install yarn.

npm i -g yarn

Fork, Build and Deployment

  1. After installing Node and Yarn, you can fork or straight download a copy of this application to start your own app.

  2. First download all the dependencies with yarn install

  3. 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

  4. Run 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.

  5. npm run lint to check styles

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.

Example: Generate a customer component

ng g c customer -d

Example: Generate a directive: search-bpx

ng g d search-box -d

Example: Generate a service: general-data

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.

Example: Generate a service & include it in a module automatically

ng g s general-data2 -m app.module

Example: Generate a class, an interface and enum

ng g cl models/customer

ng g i models/person

ng g enum models/gender

Example: Generate a pipe

ng g pipe shared/init-caps

Generate a module

Create a login directory and generate a login module in that directory

ng g module login/login.module

Add/Generate Routing Features

Generate a module called admin and add routing feature to it.

ng g module admin --routing

Accessibility Guidance

For guidance on how to make your app accessible, see our /ACCESSIBILITY.md docs for more info.

Running Tests

Unit tests

Set up via Karma, Jasmine

  1. ng test by default to watch file changes

End-to-end tests

Set 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.

Getting Help

  1. To get more help on the Angular CLI use ng help or go check out the Angular CLI README.
  2. ng doc component to look up documentation for features
  3. ng serve --help to look up doc for ng serve command

Change aspects of the application

Change style dialect

ng set default.styleExt css

Regenerate a brand new project with routing and scss options

ng new my-app --routing --style scss

Build and Deployment

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.

Configuration

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.

  • Set the environment variable CONFIG_ENDPOINT to an ipv4 addr of the service in order to provide configuration data to front-ends dynamically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.