latest
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<table id="bookListTable" class="table bordered highlight">
|
<table id="bookListTable" class="table bordered highlight">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox"/></th>
|
<th><input type="checkbox" (change)="updateSelected($event.target.checked)" /></th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Author</th>
|
<th>Author</th>
|
||||||
<th>Category</th>
|
<th>Category</th>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<tr *ngFor="let book of bookList">
|
<tr *ngFor="let book of bookList">
|
||||||
<td>
|
<td>
|
||||||
<input hidden="hidden" name="id" />
|
<input hidden="hidden" name="id" />
|
||||||
<input type="checkbox" [checked]="checked" (change)="updateRemoveBookList($event.target.checked, book)" />
|
<input type="checkbox" [checked]="allChecked" (change)="updateRemoveBookList($event.target.checked, book)" />
|
||||||
</td>
|
</td>
|
||||||
<td><a (click)="onSelect(book)" style="cursor: pointer">{{book.title}}</a></td>
|
<td><a (click)="onSelect(book)" style="cursor: pointer">{{book.title}}</a></td>
|
||||||
<td>{{book.author}}</td>
|
<td>{{book.author}}</td>
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import {MdDialog, MdDialogRef} from '@angular/material';
|
|||||||
export class BookListComponent implements OnInit {
|
export class BookListComponent implements OnInit {
|
||||||
|
|
||||||
private selectedBook : Book;
|
private selectedBook : Book;
|
||||||
|
private checked:boolean;
|
||||||
private bookList: Book[];
|
private bookList: Book[];
|
||||||
|
private allChecked:boolean;
|
||||||
private removeBookList: Book[]=new Array();
|
private removeBookList: Book[]=new Array();
|
||||||
|
|
||||||
constructor(private removeBookService:RemoveBookService, private getBookListService: GetBookListService, private router: Router, public dialog: MdDialog) {
|
constructor(private removeBookService:RemoveBookService, private getBookListService: GetBookListService, private router: Router, public dialog: MdDialog) {
|
||||||
@@ -48,7 +50,7 @@ export class BookListComponent implements OnInit {
|
|||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -63,6 +65,16 @@ export class BookListComponent implements OnInit {
|
|||||||
console.log(this.removeBookList);
|
console.log(this.removeBookList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSelected(checked:boolean){
|
||||||
|
if(checked) {
|
||||||
|
this.allChecked=true;
|
||||||
|
this.removeBookList=this.bookList;
|
||||||
|
} else {
|
||||||
|
this.allChecked=false;
|
||||||
|
this.removeBookList=[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
removeSelectedBooks() {
|
removeSelectedBooks() {
|
||||||
let dialogRef = this.dialog.open(DialogResultExampleDialog);
|
let dialogRef = this.dialog.open(DialogResultExampleDialog);
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
@@ -73,7 +85,7 @@ export class BookListComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
12
bookstore-api/.idea/workspace.xml
generated
12
bookstore-api/.idea/workspace.xml
generated
@@ -19,8 +19,8 @@
|
|||||||
<file leaf-file-name="BookResource.java" pinned="false" current-in-tab="true">
|
<file leaf-file-name="BookResource.java" pinned="false" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/bookstore/resource/BookResource.java">
|
<entry file="file://$PROJECT_DIR$/src/main/java/com/bookstore/resource/BookResource.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="450">
|
<state relative-caret-position="420">
|
||||||
<caret line="124" column="5" lean-forward="true" selection-start-line="124" selection-start-column="5" selection-end-line="124" selection-end-column="5" />
|
<caret line="59" column="9" lean-forward="true" selection-start-line="59" selection-start-column="9" selection-end-line="59" selection-end-column="9" />
|
||||||
<folding />
|
<folding />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
@@ -841,12 +841,12 @@
|
|||||||
<workItem from="1486538831944" duration="450000" />
|
<workItem from="1486538831944" duration="450000" />
|
||||||
<workItem from="1488378219247" duration="650000" />
|
<workItem from="1488378219247" duration="650000" />
|
||||||
<workItem from="1488461561430" duration="18419000" />
|
<workItem from="1488461561430" duration="18419000" />
|
||||||
<workItem from="1488731165185" duration="7270000" />
|
<workItem from="1488731165185" duration="8339000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="69282000" />
|
<option name="totallyTimeSpent" value="70351000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="71" y="38" width="1663" height="961" extended-state="0" />
|
<frame x="71" y="38" width="1663" height="961" extended-state="0" />
|
||||||
@@ -1257,8 +1257,8 @@
|
|||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/src/main/java/com/bookstore/resource/BookResource.java">
|
<entry file="file://$PROJECT_DIR$/src/main/java/com/bookstore/resource/BookResource.java">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="450">
|
<state relative-caret-position="420">
|
||||||
<caret line="124" column="5" lean-forward="true" selection-start-line="124" selection-start-column="5" selection-end-line="124" selection-end-column="5" />
|
<caret line="59" column="9" lean-forward="true" selection-start-line="59" selection-start-column="9" selection-end-line="59" selection-end-column="9" />
|
||||||
<folding />
|
<folding />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
Reference in New Issue
Block a user