I'm currently developing a voting application as part of my freecodecamp project using the MEAN stack. I have completed the backend portion, but without user authentication for now.
My focus now is on the frontend. I have created an HTML page that lists all the polls. Ideally, when clicking on a specific poll, I should be directed to a template displaying the poll options and vote counts using the ng-route library. However, instead of getting the HTML page, I'm receiving a JSON array from the Node server.
Below are snippets of my code:
index.html
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
... (code omitted for brevity) ...
</body>
</html>
app.js
... (app.js code snippet omitted) ...
routes.js
... (routes.js code snippet omitted) ...
poll-read-controller.js
... (poll-read-controller.js code snippet omitted) ...
poll_view.html
... (poll-view.html code snippet omitted) ...
Instead of an HTML page, I'm receiving the following JSON data:
... (JSON data snippet omitted) ...
server/index.js
... (server/index.js code snippet omitted) ...
Link to my project:
Note: I'm relatively new to the MEAN stack (two months of learning), so any feedback or corrections on the code are welcome.