This project was generated with Angular CLI version 1.2.0.
Run ng serve to serve the live development server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
We can use the development server for testing any live CSS/HTML changes. Only do a full build when testing the API and mongoDB connections.
Note the development server runs on port 4200 while the full build runs on port 3000.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.
The -prod flag can be added to both the ng build and ng serve commands. In components, this will set the global variable environment.production to true. Note that in production, Angular minifys JS and CSS files so the project runs a lot smoother.
We can test both the API and our development changes by doing the following:
- Navigate to project folder, run
npm installto install any missing dependencies. - Make sure you have mongoDB installed and it is running on port 27017.
- Run
ng buildto build the project. - Run
npm startto run the project. - Navigate http://localhost:3000/ in your browser.
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 build--ng bng serve--ng sng generate component--ng g c
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.