August 2017
Beginner to intermediate
370 pages
8h 37m
English
For illustration purposes, we will consider DoctorService, which has these two APIs:
The following is the sample code for DoctorService representing the aforementioned APIs. We will write a couple of unit tests to test each of the APIs:
import { Injectable } from '@angular/core';import { Http, Response } from '@angular/http';import { Observable } from 'rxjs/Observable';import 'rxjs/add/operator/catch';import 'rxjs/add/operator/map';import 'rxjs/add/observable/throw';import { Doctor } from './doctor' ...
Read now
Unlock full access