mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
76654: PaginationService
This commit is contained in:
@@ -7,6 +7,7 @@ import { fadeIn, fadeInOut } from '../animations/fade';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ListableObject } from '../object-collection/shared/listable-object.model';
|
||||
import { getStartsWithComponent, StartsWithType } from '../starts-with/starts-with-decorator';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-browse-by',
|
||||
@@ -96,7 +97,9 @@ export class BrowseByComponent implements OnInit {
|
||||
*/
|
||||
public sortDirections = SortDirection;
|
||||
|
||||
public constructor(private injector: Injector) {
|
||||
public constructor(private injector: Injector,
|
||||
protected paginationService: PaginationService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
@@ -119,8 +122,7 @@ export class BrowseByComponent implements OnInit {
|
||||
* @param size
|
||||
*/
|
||||
doPageSizeChange(size) {
|
||||
this.paginationConfig.pageSize = size;
|
||||
this.pageSizeChange.emit(size);
|
||||
this.paginationService.updateRoute(this.paginationConfig.id,{pageSize: size});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,8 +130,7 @@ export class BrowseByComponent implements OnInit {
|
||||
* @param direction
|
||||
*/
|
||||
doSortDirectionChange(direction) {
|
||||
this.sortConfig.direction = direction;
|
||||
this.sortDirectionChange.emit(direction);
|
||||
this.paginationService.updateRoute(this.paginationConfig.id,{sortDirection: direction});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +142,10 @@ export class BrowseByComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.objectInjector = Injector.create({
|
||||
providers: [{ provide: 'startsWithOptions', useFactory: () => (this.startsWithOptions), deps:[] }],
|
||||
providers: [
|
||||
{ provide: 'startsWithOptions', useFactory: () => (this.startsWithOptions), deps:[] },
|
||||
{ provide: 'paginationId', useFactory: () => (this.paginationConfig.id), deps:[] }
|
||||
],
|
||||
parent: this.injector
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user