-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
71 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import 'rxjs/add/operator/map'; | ||
import { Injectable } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Book } from '../../books/models/book'; | ||
|
||
@Injectable() | ||
export class GoogleBooksService { | ||
private API_PATH = 'https://www.googleapis.com/books/v1/volumes'; | ||
|
||
constructor(private http: Http) {} | ||
constructor(private http: HttpClient) {} | ||
|
||
searchBooks(queryTitle: string): Observable<Book[]> { | ||
return this.http | ||
.get(`${this.API_PATH}?q=${queryTitle}`) | ||
.map(res => res.json().items || []); | ||
.get<{ items: Book[] }>(`${this.API_PATH}?q=${queryTitle}`) | ||
.map(books => books.items || []); | ||
} | ||
|
||
retrieveBook(volumeId: string): Observable<Book> { | ||
return this.http.get(`${this.API_PATH}/${volumeId}`).map(res => res.json()); | ||
return this.http.get<Book>(`${this.API_PATH}/${volumeId}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,13 @@ | |
"type": "git", | ||
"url": "git+https://github.com/ngrx/platform.git" | ||
}, | ||
"keywords": [ | ||
"RxJS", | ||
"Angular", | ||
"Redux" | ||
], | ||
"authors": [ | ||
"Victor Savkin <[email protected]>" | ||
], | ||
"keywords": ["RxJS", "Angular", "Redux"], | ||
"authors": ["Victor Savkin <[email protected]>"], | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/router": "^4.0.0", | ||
"@angular/common": "^4.0.0 || ^5.0.0-rc.2", | ||
"@angular/core": "^4.0.0 || ^5.0.0-rc.2", | ||
"@angular/router": "^4.0.0 || ^5.0.0-rc.2", | ||
"@ngrx/store": "^4.0.0", | ||
"rxjs": "^5.0.0" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,15 @@ | |
"type": "git", | ||
"url": "git+https://github.com/ngrx/platform.git" | ||
}, | ||
"keywords": [ | ||
"RxJS", | ||
"Angular", | ||
"Redux" | ||
], | ||
"keywords": ["RxJS", "Angular", "Redux"], | ||
"author": "Rob Wormald <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ngrx/platform/issues" | ||
}, | ||
"homepage": "https://github.com/ngrx/platform#readme", | ||
"peerDependencies": { | ||
"@angular/core": "^4.0.0", | ||
"@angular/core": "^4.0.0 || ^5.0.0-rc.2", | ||
"rxjs": "^5.0.0" | ||
} | ||
} |