I'm learning angular. I'm working on simple book management app. When user clicks on "Add to favorites, That book will be added to favorites page. Up to now, I have build start page, login page, and register page. I'm using JSON as a database (books.json and users.json) and using JSON-server to host the data. Here my Question is, When the new user is created, How to create Empty Wishlist automatically? And based on Mail id, how to get Id of that object? I have tried some methods in YouTube and documentation. but I was failed.
So can you show us the code where you register a new user?
On a sidenote, your login code is extremely insecure. Not only are you saving passwords in plain text, when a user tries to log in you are retrieving a password from the server and validating it on the client side. That means that any user can discover the password of any other user just by trying random user names and inspecting the response that comes from the server.
Thank you for your time Stephan. I really appreciate your time and efforts. I actually used https://www.npmjs.com/package/json-server#getting-started this method to host the JSON server. The codes I have mentioned below are the only codes I have used. And also I have achieved this creating the empty wish-list just now. it's very simple. I have just added two empty lists in register-page.component.ts
and whenever I created any new user, It was created automatically.
The only thing left is I want to export either emailId or ID of the user logged in from the login-page.component.ts to favorite-page.component.ts. Please help me If you could. Thanks.