Currently, I am working on transitioning my todo application to store todos in a MongoDB database instead of a JSON file. After setting up the backend and adjusting my Angular functions to communicate with the backend, I encountered a few issues.
- Despite specifying name values in the database, the todo boxes remain empty
- Upon page load, the data fetched from the database appears as five empty todo boxes although there are two objects present in the database which is also confirmed through console logs
- When performing a post request through Postman, only the parameters generated by MongoDB appear in the database for the todo task instead of the specified name
Below is an excerpt from my server.js file:
// Code snippet for connecting to the MongoDB database
// More server code here...
The issue might be in my controller script which connects the frontend to the backend:
// Relevant JavaScript code related to the frontend-backend connection
// More controller code here...
Any insights on what could be causing these problems?
You can access the main files used for this project on Plunkr