2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'showTitle',
|
|
|
|
template: `
|
2018-10-03 16:12:42 +02:00
|
|
|
<h2 *ngIf="title != undefined" class="landingTitle">
|
2017-12-19 13:53:46 +01:00
|
|
|
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
|
|
|
class="custom-external">
|
2018-06-28 16:52:45 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
<a *ngIf="title['name'] != undefined && title['name'] != ''"
|
|
|
|
href="{{title['url']}}" target="_blank"
|
|
|
|
[innerHTML]="title['name']">
|
|
|
|
</a>
|
|
|
|
<a *ngIf="title['name'] == undefined || title['name'] == ''"
|
|
|
|
href="{{title['url']}}" target="_blank">
|
|
|
|
[no title available]
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
<span *ngIf="(title['name'] != undefined && title['name'] != '') &&
|
|
|
|
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
|
|
|
|
[innerHTML]="title['name']">
|
|
|
|
</span>
|
|
|
|
<span *ngIf="(title['name'] == undefined || title['name'] == '') &&
|
|
|
|
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
|
|
|
|
>
|
|
|
|
[no title available]
|
|
|
|
</span>
|
|
|
|
</h2>
|
2018-06-28 16:52:45 +02:00
|
|
|
<h2 *ngIf="titleName">
|
|
|
|
<span [innerHTML]="titleName"></span>
|
|
|
|
</h2>
|
|
|
|
<h2 *ngIf="!titleName && !title">
|
|
|
|
<span>[no title available]</span>
|
|
|
|
</h2>
|
2017-12-19 13:53:46 +01:00
|
|
|
`
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ShowTitleComponent {
|
2018-06-28 16:52:45 +02:00
|
|
|
@Input() titleName: string;
|
2017-12-19 13:53:46 +01:00
|
|
|
@Input() title: { [key: string]: string };
|
|
|
|
@Input() iconClass:string;
|
|
|
|
|
|
|
|
sub: any;
|
|
|
|
|
|
|
|
constructor (private route: ActivatedRoute) {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.sub = this.route.queryParams.subscribe(
|
|
|
|
params => {
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
this.sub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|