Node 6.x must be installed.
Note, use angular/cli, do not use angular/angular-cli
npm i -g @angular/cling is the CLI itself
Verify the installation
npm list -g @angular/cli --depth=0
ng -vInstall yarn
npm i -g yarn- After installing Node and Yarn, you can fork or straight download a copy of this application to start your own app.
- First download all the dependencies with
yarn install - Please set your PATH, MINIO_HOST, MINIO_ACCESS_KEY, MINIO_SECRET_KEY, and MONGODB_DATABASE variables before running.
-
export MONGODB_DATABASE=“mean-dev”
-
export MINIO_HOST="minio-esm-dev-esm-dev.pathfinder.gov.bc.ca"
-
export PATH="[you path here]"
-
export MINIO_ACCESS_KEY="[access key here]"
-
export MINIO_SECRET="[secret key here]"
-
Run
npm startto start the webpack server to run the application on port 3300Navigate to
http://localhost:3300to verify that the application is running💡 To change the default port, open
.angular-cli.json, change the value ondefaults.serve.port -
Run
npm run buildto build the project. The build artifacts will be stored in thedist/directory. Use the-prodflag for a production build, like so:ng serve --prodto run in production mode. -
Run
npm run lintto lint your app code usingTSLint
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.
ng g c customerng g d search-boxng g s general-dataAngular 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# class
ng g cl models/customer
# interface
ng g i models/person
# enum
ng g enum models/genderng g pipe shared/init-capsCreate a login directory and generate a login module in that directory
ng g module login/login.moduleGenerate a module called admin and add routing feature to it.
ng g module admin --routing- Run
npm testto execute the unit tests.
Set up with BDDStack.
- Run
npm run e2eto automatically start the application locally and execute the end-to-end tests.
- Determine the URL at which the application is running.
- Update the baseurl to the URL from step 1:
- Either modify the GebConfig.groovy baseUrl directly.
- Or set a
BASEURLenvironment variable
- See
functional-tests/readme.mdfor how to execute the tests.
See the BDDStack Wiki for more information.
ng set default.styleExt cssng new my-app --routing --style scss- To get more help on the Angular CLI use
ng helpor go check out the Angular CLI README ng doc componentto look up documentation for featuresng serve --helpto look up doc forng servecommand
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.
To use our Visual Studio Code extensions copy the contents of vscodeextensions.txt in the root directory and paste it into bash. If it doesnt work, make sure you have the Code CLI installed code --version and if it's not installed open the command palette (shift + command + p) and run Shell Command: install 'code' command in PATH.
Feel free to create pull requests from the default "master" branch, click here to create one automatically: https://github.com/bcgov/eao-public/pull/new/master