Skip to content

📋 App to retrieve and display book details from the Google books API

License

Notifications You must be signed in to change notification settings

AndrewJBateman/angular-api-booklist

Repository files navigation

⚡ Angular API Booklist

  • 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

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Book search form and search results displayed using mat-cards

📷 Screenshots

  • Example screenshot

📶 Technologies

💾 Setup

  • Install dependencies using npm i
  • Run ng serve to get a server at http://localhost:4200/
  • If required, run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

💻 Code Examples

  • 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));
  }
}

🆒 Features

  • Google book search API does not require a key
  • Uses *ngFor first and last of list identifiers to change CSS class colors

📋 Status & To-Do List

  • Status: Working
  • To-Do: Add book-detail, improve side-nav

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact