Registering users

Our application should support user registration. We already have the backend logic for this functionality. Now, all we have to do is tie it up with our Angular application. To do this, we are going to create a generic module called auth, which will be used for both registering and authenticating users.

The auth service

We will continue with the auth service, which will hold all the communication logic with the Node.js backend application. Create a file called public/src/auth/services/auth.service.ts and implement the entire logic of the service by following these steps:

  1. Import the dependencies:
    import { Injectable } from 'angular2/core'; import { Http, Response, Headers } from 'angular2/http'; import { Subject } from 'rxjs/Subject'; ...

Get MEAN Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.