d
This commit is contained in:
@@ -26,26 +26,6 @@
|
|||||||
|
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-6 text-center">
|
|
||||||
<ul class="pagination">
|
|
||||||
<li *ngFor="#item of queryMaxPages; #i = index"><a href="#">1</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-6 text-center">
|
|
||||||
<button *ngIf="showBack" class="btn btn-primary" (click)="backPage()">Back Page</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6 text-center">
|
|
||||||
<button *ngIf="showNext" class="btn btn-primary" (click)="nextPage()">Next Page</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
>>>>>>> abfe4ee830cfae95721bac32b34103b2538680eb
|
|
||||||
|
|
||||||
<div *ngIf="isEmptyObject(gamesData)">
|
<div *ngIf="isEmptyObject(gamesData)">
|
||||||
<div class="flex-container" >
|
<div class="flex-container" >
|
||||||
|
|||||||
@@ -22,16 +22,10 @@ export class GameGridComponent implements OnInit {
|
|||||||
queryFilters = "";
|
queryFilters = "";
|
||||||
querryPage = 1;
|
querryPage = 1;
|
||||||
queryOrder = "Title";
|
queryOrder = "Title";
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
length = 100;
|
length = 100;
|
||||||
pageSize = 10;
|
pageSize = 10;
|
||||||
pageSizeOptions = [5, 10, 25, 50, 100];
|
pageSizeOptions = [5, 10, 25, 50, 100];
|
||||||
=======
|
|
||||||
queryRecordMax = 9;
|
|
||||||
queryMaxPages = 0;
|
|
||||||
index = 0;
|
|
||||||
>>>>>>> abfe4ee830cfae95721bac32b34103b2538680eb
|
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -51,24 +45,6 @@ export class GameGridComponent implements OnInit {
|
|||||||
this.gameListSubscription = this.gamesService.getGames( this.queryFilters, this.querryPage, this.queryOrder, this.pageSize ).subscribe( data => {
|
this.gameListSubscription = this.gamesService.getGames( this.queryFilters, this.querryPage, this.queryOrder, this.pageSize ).subscribe( data => {
|
||||||
this.length = data["_results"];
|
this.length = data["_results"];
|
||||||
this.gamesData = data.games;
|
this.gamesData = data.games;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
|
|
||||||
this.queryMaxPages = Math.round( data._results / this.queryRecordMax );
|
|
||||||
console.log( this.queryMaxPages );
|
|
||||||
|
|
||||||
if( this.gamesData.length < this.queryRecordMax ){
|
|
||||||
this.showNext = false;
|
|
||||||
}else{
|
|
||||||
this.showNext = true;
|
|
||||||
}
|
|
||||||
if( this.querryPage != 1 ){
|
|
||||||
this.showBack = true;
|
|
||||||
}else{
|
|
||||||
this.showBack = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
>>>>>>> abfe4ee830cfae95721bac32b34103b2538680eb
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ export class GamesService {
|
|||||||
getGames( queryFilters, querryPage, queryOrder, queryRecordMax ): Observable<any> {
|
getGames( queryFilters, querryPage, queryOrder, queryRecordMax ): Observable<any> {
|
||||||
return this.http.get( this.APIURL + "/games?filter="+ queryFilters +"&page="+ querryPage + "," + queryRecordMax +"&order="+ queryOrder +"&transform=1" )
|
return this.http.get( this.APIURL + "/games?filter="+ queryFilters +"&page="+ querryPage + "," + queryRecordMax +"&order="+ queryOrder +"&transform=1" )
|
||||||
.map(res => {
|
.map(res => {
|
||||||
console.log( res );
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
res
|
res
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user