dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/showTitle.component.ts @ 59816
1 |
import {Component, Input} from '@angular/core'; |
---|---|
2 |
import {ActivatedRoute} from '@angular/router'; |
3 |
|
4 |
@Component({ |
5 |
selector: 'showTitle', |
6 |
template: ` |
7 |
<h1 [ngClass]="classNames">
|
8 |
<div *ngIf="title != undefined" class="landingTitle">
|
9 |
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
10 |
class="custom-external">
|
11 |
<a *ngIf="title['name'] != undefined && title['name'] != ''"
|
12 |
href="{{title['url']}}" target="_blank"
|
13 |
[innerHTML]="title['name']">
|
14 |
</a>
|
15 |
<a *ngIf="title['name'] == undefined || title['name'] == ''"
|
16 |
href="{{title['url']}}" target="_blank">
|
17 |
[no title available]
|
18 |
</a>
|
19 |
</span>
|
20 |
<span *ngIf="(title['name'] != undefined && title['name'] != '') &&
|
21 |
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
|
22 |
[innerHTML]="title['name']">
|
23 |
</span>
|
24 |
<span *ngIf="(title['name'] == undefined || title['name'] == '') &&
|
25 |
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
|
26 |
>
|
27 |
[no title available]
|
28 |
</span>
|
29 |
</div>
|
30 |
<div *ngIf="titleName">
|
31 |
<span [innerHTML]="titleName"></span>
|
32 |
</div>
|
33 |
<div *ngIf="!titleName && !title">
|
34 |
<span>No title available</span>
|
35 |
</div>
|
36 |
</h1>
|
37 |
`
|
38 |
|
39 |
})
|
40 |
|
41 |
export class ShowTitleComponent { |
42 |
@Input() titleName: string; |
43 |
@Input() title: { [key: string]: string }; |
44 |
@Input() iconClass:string; |
45 |
@Input() classNames: string = ""; |
46 |
|
47 |
constructor () {} |
48 |
|
49 |
}
|