Actually Asked Questions

No. Topic Question
Answer
1 Data Model I'm now going to do the back-end task, but I'm confused with the number of arrays in the orders page alone. In the HTML, the if statement says it's from orderL0, but it looks like orderL0 has both the product list and how many are ordered. Could you please explain what the menu, orderL0 and orderL1 arrays in order.component.ts are supposed to represent? orderL0 (or “Order Level 0”) represents a complete order. A complete order is an array of itemListObjects. If you look at orderedItem.ts you will notice that itemListObjects include an array of OrderedItems. Then orderL1 (or “Order Level 1”) is at a lower hierarchy level because it is precisely that: an array of OrderedItems. If you take the pizza example, just think about a restaurant that does not specialize in pizzas, but they have them in the menu. Suppose you are with a group of friends and you are making a single order for all of them. To make the case simple, suppose that each of them wants only one slice. Then you keep adding pizza slices for a total of six slices Each slice is an itemListObject. The main view of your order will not show the details, but it happens that your friends want different pizza ingredients. If you go into the detail view (right now it is being handled by clicking on the image), what you will be looking at is an array of OrderedItems. That is where options for each of the pizza slice are selected. If you look at orderedItem.ts again you will see that the customerSelections (the options field) are there. There are certain things that might need to be fixed in the Data Model, but we need to make those changes in a way that does not disrupt the work of others, therefore you commit changes when for example you are sure that your changes do not impact data posting. We need the back-end working all the time in order to build the orders management module. In relation to the changes that you made to the persist service, I do not know if you have committed your changes. Please let me know. Also, please confirm that you deployed in your machine up to the point where you can post data. When you say “I just moved the order URL from the persist service into the config/environment files and it works just as well”, does that mean that after your changes the application was still able to post data ?
2 Front-End / Back-End Interaction I haven't committed my changes to persist.ts yet. I'm not sure if I have deployed my machine to where I can post data. Should the process be in your FF Local Installation page? Yes, the instructions are there. You must build and test your back end. Both must be executing simultaneously in separate console windows. Of course, for production deployment those will be detached processes. But for now, you just use console windows. The URL in the persist.service.ts module refers to the back-end who will be listening on port 3000. The front end sends POST requests with application/json content to the back-end. You must make sure that these transactions are working by following the deployment instructions. In the end you must go to the MongoDB database and verify that data is being posted. In relation to the assigned task, when you move the URL to a configuration file, then you must code in order to read the URL from the configuration so that the persist service can use it to talk to the back-end. If you are successful in building and testing the back-end and then after you make your changes the application cannot talk to the back end, then there is something wrong.