mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
Implement collection home page
Shows the following fields if they exist: * title * logo * introductory text * news (also referred to as sidebarText) * copyright text * license Fixes https://github.com/DSpace/dspace-angular/issues/63
This commit is contained in:
35
src/app/collection-page/collection-page.component.ts
Normal file
35
src/app/collection-page/collection-page.component.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
|
||||
import { Collection } from "../core/shared/collection.model";
|
||||
import { Bitstream } from "../core/shared/bitstream.model";
|
||||
import { RemoteData } from "../core/data/remote-data";
|
||||
import { CollectionDataService } from "../core/data/collection-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-collection-page',
|
||||
styleUrls: ['./collection-page.component.css'],
|
||||
templateUrl: './collection-page.component.html',
|
||||
})
|
||||
export class CollectionPageComponent implements OnInit {
|
||||
collectionData: RemoteData<Collection>;
|
||||
logoData: RemoteData<Bitstream>;
|
||||
|
||||
constructor(
|
||||
private collectionDataService: CollectionDataService,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
this.universalInit();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.params.subscribe((params: Params) => {
|
||||
this.collectionData = this.collectionDataService.findById(params['id'])
|
||||
this.collectionData.payload
|
||||
.subscribe(collection => this.logoData = collection.logo);
|
||||
});
|
||||
}
|
||||
|
||||
universalInit() {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user