diff --git a/admin-portal/src/app/components/book-list/book-list.component.html b/admin-portal/src/app/components/book-list/book-list.component.html index 59e4730..c26b2c5 100644 --- a/admin-portal/src/app/components/book-list/book-list.component.html +++ b/admin-portal/src/app/components/book-list/book-list.component.html @@ -3,7 +3,7 @@
| + | Title | Author | Category | @@ -17,7 +17,7 @@|
|---|---|---|---|---|
| - + | {{book.title}} | {{book.author}} | diff --git a/admin-portal/src/app/components/book-list/book-list.component.ts b/admin-portal/src/app/components/book-list/book-list.component.ts index 9a3cd34..7259090 100644 --- a/admin-portal/src/app/components/book-list/book-list.component.ts +++ b/admin-portal/src/app/components/book-list/book-list.component.ts @@ -15,7 +15,9 @@ import {MdDialog, MdDialogRef} from '@angular/material'; export class BookListComponent implements OnInit { private selectedBook : Book; + private checked:boolean; private bookList: Book[]; + private allChecked:boolean; private removeBookList: Book[]=new Array(); constructor(private removeBookService:RemoveBookService, private getBookListService: GetBookListService, private router: Router, public dialog: MdDialog) { @@ -48,7 +50,7 @@ export class BookListComponent implements OnInit { err => { console.log(err); } - + ); } }); @@ -63,6 +65,16 @@ export class BookListComponent implements OnInit { console.log(this.removeBookList); } + updateSelected(checked:boolean){ + if(checked) { + this.allChecked=true; + this.removeBookList=this.bookList; + } else { + this.allChecked=false; + this.removeBookList=[]; + } + } + removeSelectedBooks() { let dialogRef = this.dialog.open(DialogResultExampleDialog); dialogRef.afterClosed().subscribe(result => { @@ -73,7 +85,7 @@ export class BookListComponent implements OnInit { }, err => { } - + ); }; location.reload(); diff --git a/bookstore-api/.idea/workspace.xml b/bookstore-api/.idea/workspace.xml index d8e5a0f..e039ca8 100644 --- a/bookstore-api/.idea/workspace.xml +++ b/bookstore-api/.idea/workspace.xml @@ -19,8 +19,8 @@