Project

General

Profile

1 50169 argiro.kok
import {Component, Input} from '@angular/core';
2
import {ActivatedRoute} from '@angular/router';
3
4
@Component({
5
    selector: 'showTitle',
6
    template: `
7 53379 argiro.kok
        <h2 *ngIf="title != undefined" class="landingTitle">
8 50169 argiro.kok
            <span   *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
9
                    class="custom-external">
10 52606 konstantin
11 50169 argiro.kok
                <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
        </h2>
30 52606 konstantin
        <h2 *ngIf="titleName">
31
          <span [innerHTML]="titleName"></span>
32
        </h2>
33
        <h2 *ngIf="!titleName && !title">
34
          <span>[no title available]</span>
35
        </h2>
36 50169 argiro.kok
    `
37
38
    })
39
40
export class ShowTitleComponent {
41 52606 konstantin
  @Input() titleName: string;
42 50169 argiro.kok
  @Input() title: { [key: string]: string };
43
  @Input() iconClass:string;
44
45
  sub: any;
46
47
  constructor (private route: ActivatedRoute) {}
48
49
  ngOnInit() {
50
    this.sub = this.route.queryParams.subscribe(
51
      params => {
52
      }
53
    );
54
  }
55
56
  ngOnDestroy() {
57
    this.sub.unsubscribe();
58
  }
59
}