mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 05:23:06 +00:00
Added unsubscribe to community logo subscription.
This commit is contained in:
@@ -22,11 +22,11 @@
|
||||
<!-- Copyright -->
|
||||
<ds-comcol-page-content
|
||||
[content]="(collectionData.payload | async)?.copyrightText"
|
||||
[hasInnerHtml]="true">>
|
||||
[hasInnerHtml]="true">
|
||||
</ds-comcol-page-content>
|
||||
<!-- Licence -->
|
||||
<ds-comcol-page-content
|
||||
[content]="(collectionData.payload | async)?.license"
|
||||
[title]="'collection.page.license'">>
|
||||
[title]="'collection.page.license'">
|
||||
</ds-comcol-page-content>
|
||||
</div>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
[content]="(communityData.payload | async)?.sidebarText"
|
||||
[hasInnerHtml]="true"
|
||||
[title]="'community.page.news'">
|
||||
</ds-comcol-page-content >
|
||||
</ds-comcol-page-content>
|
||||
<!-- Copyright -->
|
||||
<ds-comcol-page-content
|
||||
[content]="(communityData.payload | async)?.copyrightText"
|
||||
|
@@ -1,19 +1,21 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
|
||||
import { Community } from "../core/shared/community.model";
|
||||
import { Bitstream } from "../core/shared/bitstream.model";
|
||||
import { RemoteData } from "../core/data/remote-data";
|
||||
import { CommunityDataService } from "../core/data/community-data.service";
|
||||
import { Subscription } from "rxjs/Subscription";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-community-page',
|
||||
styleUrls: ['./community-page.component.css'],
|
||||
templateUrl: './community-page.component.html',
|
||||
})
|
||||
export class CommunityPageComponent implements OnInit {
|
||||
export class CommunityPageComponent implements OnInit, OnDestroy {
|
||||
communityData: RemoteData<Community>;
|
||||
logoData: RemoteData<Bitstream>;
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
constructor(
|
||||
private communityDataService: CommunityDataService,
|
||||
@@ -24,12 +26,16 @@ export class CommunityPageComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.params.subscribe((params: Params) => {
|
||||
this.communityData = this.communityDataService.findById(params['id'])
|
||||
this.communityData.payload
|
||||
.subscribe(community => this.logoData = community.logo);
|
||||
this.communityData = this.communityDataService.findById(params['id']);
|
||||
this.subs.push(this.communityData.payload
|
||||
.subscribe(community => this.logoData = community.logo));
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.subs.forEach(sub => sub.unsubscribe());
|
||||
}
|
||||
|
||||
universalInit() {
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
export const COMMUNITIES = [
|
||||
export const COMMUNITIES = {
|
||||
"communities": [
|
||||
{
|
||||
"name": "Community 1",
|
||||
"handle": "10673/1",
|
||||
@@ -84,4 +85,5 @@ export const COMMUNITIES = [
|
||||
]
|
||||
}
|
||||
}
|
||||
];
|
||||
]
|
||||
};
|
Reference in New Issue
Block a user