The Login Page
Our next step is to create some method of logging in together with saving what is in our shopping cart. We are not going to create a full fledged web shop, so for the sake of learning, we will manually insert two users into the database, so we can log in and remember what is in each of their shopping carts. Before we can save anything to MongoDB, we must first create a login page for our website. Create a view and name it login.ejs. The contents are pretty much the same as that on other pages. Same stylesheets, scripts, and footer. The part that is different goes in container div. I am using a form element so Angular does the required validation for us. Other than that, it is not much different from doing a regular AJAX POST ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access