import {Component, Input, OnInit} from "@angular/core"; @Component({ selector: 'notification-user', template: ` {{firstLetters}} `, styleUrls: ['notification-user.component.css'] }) export class NotificationUserComponent implements OnInit{ @Input() public name: string; @Input() public surname: string; @Input() public colorClass = 'portal-color'; @Input() public outline: boolean = false; public firstLetters: string; ngOnInit() { if(this.name && this.surname) { this.firstLetters = this.name.charAt(0) + this.surname.charAt(0); } } }