Skip to content

Commit 961b532

Browse files
BaggersIOrobinboehm
authored andcommitted
Add a Book Interface
1 parent fa5eda7 commit 961b532

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/app/book-list/book-list.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { Book } from '../shared/book';
23

34
@Component({
45
selector: 'book-list',
@@ -7,7 +8,7 @@ import { Component, OnInit } from '@angular/core';
78
})
89
export class BookListComponent implements OnInit {
910

10-
books = [
11+
books: [Book] = [
1112
{
1213
"title": "Design Patterns",
1314
"subtitle": "Elements of Reusable Object-Oriented Software",

src/app/shared/book.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export interface Book {
2+
title: string;
3+
subtitle: string;
4+
isbn: string;
5+
abstract: string;
6+
numPages: number;
7+
author: string;
8+
publisher: {
9+
name: string;
10+
url: string;
11+
}
12+
}

0 commit comments

Comments
 (0)