forked from hazza/dspace-angular
Added tests and comments
This commit is contained in:
@@ -24,17 +24,44 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o
|
||||
templateUrl: './object-detail.component.html',
|
||||
animations: [fadeIn]
|
||||
})
|
||||
|
||||
export class ObjectDetailComponent {
|
||||
|
||||
/**
|
||||
* Pagination options object
|
||||
*/
|
||||
@Input() config: PaginationComponentOptions;
|
||||
|
||||
/**
|
||||
* Sort options object
|
||||
*/
|
||||
@Input() sortConfig: SortOptions;
|
||||
@Input() hideGear = false;
|
||||
|
||||
/**
|
||||
* A boolean representing if to hide gear pagination icon
|
||||
*/
|
||||
@Input() hideGear = true;
|
||||
|
||||
/**
|
||||
* A boolean representing if to hide pagination when there is only a page
|
||||
*/
|
||||
@Input() hidePagerWhenSinglePage = true;
|
||||
|
||||
/**
|
||||
* The list of objects to paginate
|
||||
*/
|
||||
private _objects: RemoteData<PaginatedList<ListableObject>>;
|
||||
|
||||
/**
|
||||
* Setter for _objects property
|
||||
* @param objects
|
||||
*/
|
||||
@Input() set objects(objects: RemoteData<PaginatedList<ListableObject>>) {
|
||||
this._objects = objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for _objects property
|
||||
*/
|
||||
get objects() {
|
||||
return this._objects;
|
||||
}
|
||||
@@ -69,6 +96,10 @@ export class ObjectDetailComponent {
|
||||
*/
|
||||
@Output() sortDirectionChange: EventEmitter<SortDirection> = new EventEmitter<SortDirection>();
|
||||
|
||||
/**
|
||||
* An event fired when the pagination is changed.
|
||||
* Event's payload equals to the newly selected sort direction.
|
||||
*/
|
||||
@Output() paginationChange: EventEmitter<SortDirection> = new EventEmitter<any>();
|
||||
|
||||
/**
|
||||
@@ -76,23 +107,38 @@ export class ObjectDetailComponent {
|
||||
* Event's payload equals to the newly selected sort field.
|
||||
*/
|
||||
@Output() sortFieldChange: EventEmitter<string> = new EventEmitter<string>();
|
||||
data: any = {};
|
||||
|
||||
/**
|
||||
* Emit pageChange event
|
||||
*/
|
||||
onPageChange(event) {
|
||||
this.pageChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit pageSizeChange event
|
||||
*/
|
||||
onPageSizeChange(event) {
|
||||
this.pageSizeChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit sortDirectionChange event
|
||||
*/
|
||||
onSortDirectionChange(event) {
|
||||
this.sortDirectionChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit sortFieldChange event
|
||||
*/
|
||||
onSortFieldChange(event) {
|
||||
this.sortFieldChange.emit(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit paginationChange event
|
||||
*/
|
||||
onPaginationChange(event) {
|
||||
this.paginationChange.emit(event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user