class CertificateInfoController { private ngModel: any; subject: string; $onInit() { this.subject = (this.ngModel.lastName !== '' || this.ngModel.firstName !== '') ? this.ngModel.lastName + ' ' + this.ngModel.firstName: this.ngModel.subject; this.subject = this.subject.trim(); } } export const CertificateInfoComponent: angular.IComponentOptions = { controller: CertificateInfoController, template: require('./certificateInfo.html'), bindings: { ngModel: '<' } };