Skip to content

Instantly share code, notes, and snippets.

@MikeRyanDev
Created August 12, 2016 15:12
Show Gist options
  • Save MikeRyanDev/9948a61b3393e81e68e74f57cf5d9776 to your computer and use it in GitHub Desktop.
Save MikeRyanDev/9948a61b3393e81e68e74f57cf5d9776 to your computer and use it in GitHub Desktop.
import 'rxjs/add/observable/of';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Book } from '../models/book';
@Injectable()
export class BooksService {
getBooks(): Observable<Book[]> {
return Observable.of([
{
title: 'The Stand',
authors: [ 'Stephen King' ],
publishDate: '2008-06-24',
description: `
A patient escapes from a biological testing facility,
unknowingly carrying a deadly weapon: a mutated strain
of super-flu that will wipe out 99 percent of the world’s
population within a few weeks.
`,
thumbnail: 'http://books.google.com/books/content?id=UbfnTcmkaKkC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api'
}
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment