import { Component, Input } from '@angular/core';
import { Model } from '../data-types';

@Component({
  selector: 'timeline-cred',
  templateUrl: '../../themes/_active/cred/timeline-cred.component.html',
})
export class TimelineCredComponent {
  protected _cred: Model.Credential;

  constructor() { }

  get credential() {
    return this._cred;
  }

  @Input() set credential(cred: Model.Credential) {
    this._cred = cred;
  }

  get related_topic_name() {
    //let topic = this._cred && this._cred.related_topics && this._cred.related_topics[0];
    //if(topic && topic.names && topic.names.length) return topic.names[0].text;
    return this._cred && this._cred.relatedPreferredName;
  }

  get topic_name() {
    return this._cred && this._cred.topic && this._cred.topic.local_name.text;
    //return this._cred && this._cred.names.length && this._cred.names[0].text;
  }

}

import { Component, Input } from '@angular/core';
import { Model } from '../data-types';

@Component({
  selector: 'timeline-cred',
  templateUrl: '../../themes/_active/cred/timeline-cred.component.html',
})
export class TimelineCredComponent {
  protected _cred: Model.Credential;

  constructor() { }

  get credential() {
    return this._cred;
  }

  @Input() set credential(cred: Model.Credential) {
    this._cred = cred;
  }

  get related_topic_name() {
    //let topic = this._cred && this._cred.related_topics && this._cred.related_topics[0];
    //if(topic && topic.names && topic.names.length) return topic.names[0].text;
    return this._cred && this._cred.relatedPreferredName;
  }

  get topic_name() {
    return this._cred && this._cred.local_name && this._cred.local_name.text;
    //return this._cred && this._cred.topic && this._cred.topic.local_name.text;
    //return this._cred && this._cred.names.length && this._cred.names[0].text;
  }

}

Fix display name on timeline
Fix display name on timeline

Signed-off-by: Ian Costanzo <57a33a5496950fec8433e4dd83347673459dcdfc@anon-solutions.ca>
