import { Component , Input } from '@angular/core' ; import { User } from '../../../models/user' ; @ Component ( { selector : 'cmdb-user-display-name' , templateUrl : './user-display-name.component.html' , styleUrls : [ './user-display-name.component.scss' ] } ) export class UserDisplayNameComponent { @ Input ( ) public user : User ; public displayName ( ) { if ( this . user . first_name && this . user . last_name ) { return `${ this . user . first_name } ${ this . user . last_name }` ; } else { return this . user . user_name ; } } }