These are the lab exercises to support the Angular Courses. In these labs we will be creating a full-blown warehouse management system. They are designed to simulate a real-world web application so your classroom experience matches more closely with how you will use Angular in the real world.
By the time you're finished, you'll have an honest-to-goodness Node/Express web server that serves RESTful JSON data that your Angular application will consume via Ajax requests with and without Observables in rxjs.
There are only two things needed to run the labs:
- Any active or current version of Node.
- The Angular cli (ng)
If you want some installation help including verification steps, go here .
Each lab's instructions are located in the instructions folder.
Each lab can be run without copying any files. Just open a bash shell, cd to the lab solution folder and type in
npm install
npm start
If you want to use a solution from a prior lab as a starter, either copy the whole folder to a new one or simply begin editing the code in that folder. Just realize that you may need to change the path to the server folder in package.json.
We have products, locations, orders, customers, and users. They are stored in collections (aka tables) in a flat file JSON database.
Have a status:
Status | Meaning |
---|---|
0 | Ready to pick, pack, and ship |
1 | Shipped |
2 | Has problem(s) that a supervisor should fix |
LocationID is a string with this format: AASHB where ...
- AA- Aisle - 01-99
- S - Slot - A-Z
- H - Shelf - 1-9
- B - Bin - A-Z
For example, 01A1A = Aisle 1, Slot A, Shelf 1, Bin A
Only one product will be stored in a location so locationID is a primary key
GET /api/orders/readyToShip
- Get a list of orders that are ready to ship (status=0 means "ready to ship". status=1 means "shipped")GET /api/orders/
- Get a list of all ordersGET /api/orders/:id
- Get a single orderPATCH /api/orders/:id/markAsShipped
- Mark the order as "shipped" (status=1)PATCH /api/orders/:id/markAsProblem
- Mark the order as "has a problem" (status=2)POST /api/orders/
- Create a new order. New order record is in the body.PUT /api/orders/:id
- Replace the order with what is in the body.DELETE /api/orders/:id
- Delete the orderPATCH /api/orders/:id
- Update the order with the values in the body.
GET /api/products
- All productsGET /api/products/:id
- A single product with that id (ids are between 1 and about 77 currently)GET /api/products/featured
- All featured products (Those we want to promote. Have featured==true)GET /api/products?search=:searchString
- All products with searchString as part of the name.PUT /api/products
- Insert a new product into the database. The product's fields are in the body.PATCH /api/products/:id
- Update the product. Updated fields are in the body.DELETE /api/products/:id
- Delete the product
GET /api/customers
- All customersPOST /api/customers
- Create a new customerGET /api/customers/:id
- A single customer. (ids are between 1 and 78)PUT /api/customers/:id
- Replace a single customerPATCH /api/customers/:id
- Update a single customerDELETE /api/customers/:id
- Delete a single customer
GET /api/categories
- All categoriesGET /api/categories/:id
- Read one category
GET /api/locations
- All locationsPOST /api/locations
- Creaes a new locationGET /api/locations/:id
- Read location for locationID idPUT /api/locations/:id
- Replace location at locationID idPATCH /api/locations/:id
- Update location at locationID idDELETE /api/locations/:id
- Delete location ID idGET /api/locations/forProduct/:id
- Get all locations where product id can be found.
GET /api/users
- All usersPOST /api/users
- Creaes a new userGET /api/users/:id
- Read user for userID idPUT /api/users/:id
- Replace user at userID idPATCH /api/users/:id
- Update user at userID idDELETE /api/users/:id
- Delete user ID idGET /api/login/:username/:password
- Get the user for that username and password combination.
Things that may be helpful to instructors teaching this course.
- Intro
- Intro Lab
- Angular CLI
- Angular CLI Lab
- Lunch
- Big Picture
- Big Picture Lab
- TypeScript
- TypeScript Lab
- Components Intro
- Lunch
- Components Intro Lab
- Built-in Directives
- Built-in Directives Lab
- Routing
- Routing Lab
- Event Binding
- Lunch
- Event Binding Lab
- Forms and 2-way Binding
- Forms and 2-way Binding Lab
- Composition with Components
- Composition with Components Lab
- Ajax
- Lunch
- Ajax Lab
- Observables
- Observables Lab
- Services
- Services Lab
- Pipes
- Lunch
- Pipes Lab
- Modules
- Modules Lab
- Noel Bergman - Solutions to some labs and proofreading