- Angular with Angular Material app to search for books from the Google Books API
- Displays initial list of books using predefined list query
- Allows user to search for books using a query string of 4 or more letters
- Note: to open web links in a new window use: ctrl+click on link
- Book search form and search results displayed using mat-cards
- Angular v15 javascript framework
- Angular Material v15 component library
- Angular Material Icons
- @ngrx/store v15 RxJS powered state management
- Install dependencies using
npm i
- Run
ng serve
to get a server athttp://localhost:4200/
- If required, run
ng build
to build the project. The build artifacts will be stored in thedist/
directory. Use the--prod
flag for a production build.
- extract from google-books.service.ts to retrieve book search items from Google Books API
export class GoogleBookService {
private API_URL = "https://www.googleapis.com/books/v1/volumes";
constructor(private http: HttpClient) {}
findBook(title: string): Observable<Book[]> {
return this.http
.get<GoogleBooksApiInterface>(`${this.API_URL}?q=${title}`)
.pipe(map((data: GoogleBooksApiInterface) => data.items));
}
}
- Google book search API does not require a key
- Uses *ngFor first and last of list identifiers to change CSS class colors
- Status: Working
- To-Do: Add book-detail, improve side-nav
- Google Books APIs: Performing a Search
- Tutorial Tips: Cannot find name '..'. Do you need to change your target library?
- This project is licensed under the terms of the MIT license.
- Repo created by ABateman, email: gomezbateman@gmail.com