1. Read the Mongo docs 2. Read the Express docs 3. Read the Angular docs 4. Read the Node docs
It’s entirely possible though that you are more like me, and you simply generated the MEAN.JS boilerplate and tried to jump right into it developing your first app, learning what you needed as it came up.
If that sounds like you, I would love to throw at you some tips that would have helped me a lot as a I started out, coming from Java and knowing very little about single-page apps or modern front-end code.
1. Build your learning app (mostly) from scratch
The boilerplate is meant for developers who need to quickly get started a production-ready MEAN app. Not necessarily developers who just want to learn all the parts. Digging into the boilerplate will throw you into a lot of other things (like grunt.js) that will complicate seeing the basics in action.
I ended up building my first MEAN app following The Code Barbarian’s ToDo list MEAN tutorial.
2. There is only one page
Others routes in the Express backend are used for configuring your REST api. That is, you call these routes from your front-end to interact with your server data. Client-side rouring (probably via angular-ui-router) is what determines the actual views content.
There are two basic ways to share code between files in Node, one uses
modules.exports and the other uses just
require() on the file that contains them and assign that to a variable, say
foo. Whatever you assign to
modules.exports will get run when you call
foo(), while whatever you assign to
exports.func will get run when you call
Sure, I had seen hashsigns in URLs before, but I just ignored them and kept on browsing. When you get into using Angular in your app, you’ll need to know what that’s all about.
Fortunately it’s not terribly complicated. It’s something called a fragment identifier. Without having to know too much, whatever comes before the # gets sent to the backend, and everything after it gets sent to Angular. If you’ve already gotten into routing with Angular, that should help clear up how you define your states for the