REST Service with Web Interface using the MEAN Stack
This tutorial is made up of a series of smaller tutorials which go over different parts of the MEAN (Mongodb, ExpressJS, AngularJS, Node.js).
- Simple REST Service with Node.js and Express. This tutorial shows you how to create a REST service with Node.js and Express, it uses an in-memory store so there is no real persistence.
- REST Service with Node.js, MongoDB and Express. This tutorial expands on the previous one, showing you how to modify the code to use MongoDB for your data store, allowing you to persist your changes to the REST service data.
- Web Interface to a Node.js REST service using Jade, Stylus, jQuery and AJAX. In this tutorial, you create a web interface to your REST service, this will get you more familiar with Jade and Stylus. It uses the more traditional jQuery/AJAX method of invoking the service.
Finally, in this tutorial we will complete the MEAN Stack by modifying the previous version to now use AngularJS. AngularJS is an extensible toolset for building the framework most suited to your application development. It lets you extend HTML vocabulary for your application resulting in an environment that is expressible, readable and quick to develop. The code for this tutorial is available here.
Creating the AngularJS Module
The first file we will modify will be userManager-client.js. Let’s take a look at the different parts of this file.
First we are creating an angular module called ‘userManagerApp’ that references the ngRoute module. The ngRoute module is used for defining routes in the module. After creating the module, we define the root route and assign it the ‘userManagerController’, which we create later in the file.