Frontend services

As we are touching only the most significant part of our application, we are going to discuss the implementation of our services used in the Angular application. I think it's important to understand the underlying communication layer with the backend application.

Auction service

AuctionService will handle all communications with the backend API to get info about a specific auction, or simply get all the available auctions. To do that, we are going to create a new file, public/src/services/auction.service.ts:

import { Injectable } from 'angular2/core'; import { Response, Headers } from 'angular2/http'; import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; import { BehaviorSubject } from 'rxjs/Subject/BehaviorSubject'; ...

Get MEAN Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.