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.
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'; import { AuthHttp } from '../auth/index'; import { contentHeaders } from '../common/headers'; import { Auction } from './auction.model'; import { SubjectAuction, ObservableAuction, ObservableAuctions } from './types'; const URL...